Compare commits

..

10 Commits

Author SHA1 Message Date
lizzie 1d23100b14 fucking prototypes 2026-08-15 20:52:18 +00:00
lizzie d1299110aa last service 2026-08-15 18:49:37 +00:00
lizzie 2799621089 fix crashes on NGC 2026-08-15 18:29:13 +00:00
lizzie da560fde52 add wlan services 2026-08-15 18:04:48 +00:00
lizzie b6078e1139 fix shit 2026-08-15 17:53:47 +00:00
lizzie 4bb0e8398a more missing services 2026-08-15 17:29:46 +00:00
lizzie f76174bd2a pcv + better oob for hle 2026-08-15 09:25:52 +00:00
lizzie 26c761736b ga 2026-08-15 08:53:05 +00:00
lizzie 66a45785ab bsd:s and bsd:u enforce socket() distinctions 2026-08-15 08:43:06 +00:00
lizzie 1c54b78734 [hle/service] fix NPad crashes, add missing homebrew services
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-08-15 08:17:38 +00:00
130 changed files with 2103 additions and 5314 deletions
+5 -21
View File
@@ -81,9 +81,6 @@ 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)
# non-linux bundled qt are static
if (YUZU_USE_BUNDLED_QT AND (APPLE OR NOT UNIX))
set(YUZU_STATIC_BUILD ON)
@@ -342,26 +339,13 @@ if (CXX_GCC OR CXX_CLANG)
endif()
elseif(ARCHITECTURE_arm64)
# See https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, armv9, native")
set(mtune generic)
set(armv8_2_target armv8.2-a+fp16+dotprod)
if (ANDROID)
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, armv8.2, armv9, native")
set(march ${armv8_2_target})
if (${YUZU_BUILD_PRESET} STREQUAL "armv9")
set(march armv9-a)
endif()
else()
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, armv8.2, armv9, native")
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
set(march armv8-a)
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv8.2")
set(march ${armv8_2_target})
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
set(march armv9-a)
endif()
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
set(march armv8-a)
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
set(march armv9-a)
endif()
endif()
@@ -539,40 +539,6 @@ object NativeLibrary {
*/
external fun installKeys(path: String, ext: String): Int
/**
* @return Whether this GPU can run the Lossless Scaling frame generation shaders,
* which are built against the Vulkan memory model.
*/
external fun supportsFrameGeneration(): Boolean
/**
* @return Path the user-supplied Lossless Scaling library is expected at.
*/
external fun getLosslessDllPath(): String
/**
* Parses the installed Lossless Scaling library and checks that every shader the
* frame generation chain needs is present.
*
* @return The result code, matching the losslessDllResults array.
*/
external fun validateLosslessDll(): Int
/**
* Translates the frame generation shaders out of the installed Lossless Scaling library
* and writes them to the SPIR-V cache. Slow, so call it off the main thread.
*
* @return The result code, matching the losslessDllResults array.
*/
external fun prepareLosslessDll(): Int
/**
* Deletes the installed Lossless Scaling library.
*
* @return Whether the library is gone after the call.
*/
external fun removeLosslessDll(): Boolean
/**
* Checks the PatchManager for any addons that are available
*
@@ -559,15 +559,6 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener, InputManager
private fun enableFullscreenImmersive() {
WindowCompat.setDecorFitsSystemWindows(window, false)
@Suppress("DEPRECATION")
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
WindowInsetsControllerCompat(window, window.decorView).let { controller ->
controller.hide(WindowInsetsCompat.Type.systemBars())
controller.systemBarsBehavior =
@@ -37,10 +37,6 @@ enum class BooleanSetting(override val key: String) : AbstractBooleanSetting {
RENDERER_PATCH_OLD_QCOM_DRIVERS("patch_old_qcom_drivers"),
RENDERER_VERTEX_INPUT_DYNAMIC_STATE("vertex_input_dynamic_state"),
RENDERER_SAMPLE_SHADING("sample_shading"),
RENDERER_FRAME_GEN("frame_gen"),
RENDERER_FRAME_GEN_FP16("frame_gen_fp16"),
RENDERER_FRAME_GEN_FLOW_SCALE_AUTO("frame_gen_flow_scale_auto"),
RENDERER_FRAME_GEN_DUMP_FLOW("frame_gen_dump_flow"),
GPU_UNSWIZZLE_ENABLED("gpu_unswizzle_enabled"),
PICTURE_IN_PICTURE("picture_in_picture"),
USE_CUSTOM_RTC("custom_rtc_enabled"),
@@ -19,10 +19,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
RENDERER_ASTC_DECODE_METHOD("accelerate_astc"),
RENDERER_ACCURACY("gpu_accuracy"),
RENDERER_RESOLUTION("resolution_setup"),
RENDERER_FRAME_GEN_MULTIPLIER("frame_gen_multiplier"),
RENDERER_FRAME_GEN_TARGET_RATE("frame_gen_target_rate"),
RENDERER_FRAME_GEN_QUEUE_TARGET("frame_gen_queue_target"),
RENDERER_FRAME_GEN_FLOW_SCALE("frame_gen_flow_scale"),
RENDERER_VSYNC("use_vsync"),
RENDERER_SCALING_FILTER("scaling_filter"),
RENDERER_ANTI_ALIASING("anti_aliasing"),
@@ -11,7 +11,6 @@ object Settings {
SECTION_ROOT(R.string.advanced_settings),
SECTION_SYSTEM(R.string.preferences_system),
SECTION_RENDERER(R.string.preferences_graphics),
SECTION_FRAME_GEN(R.string.frame_gen),
SECTION_PERFORMANCE_STATS(R.string.stats_overlay_options),
SECTION_INPUT_OVERLAY(R.string.input_overlay_options),
SECTION_SOC_OVERLAY(R.string.soc_overlay_options),
@@ -21,7 +21,6 @@ import org.yuzu.yuzu_emu.features.settings.model.LongSetting
import org.yuzu.yuzu_emu.features.settings.model.ShortSetting
import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.network.NetDataValidators
import org.yuzu.yuzu_emu.utils.LosslessScalingHelper
import org.yuzu.yuzu_emu.utils.NativeConfig
/**
@@ -66,19 +65,6 @@ abstract class SettingsItem(
return NativeLibrary.isFirmwareAvailable()
}
if (setting.key in frameGenKeys &&
!(LosslessScalingHelper.isInstalled() && LosslessScalingHelper.isSupportedByGpu())
) {
return false
}
// A frame rate target moves the multiplier on its own
if (setting.key == IntSetting.RENDERER_FRAME_GEN_MULTIPLIER.key &&
frameGenTargetRate != 0
) {
return false
}
// Can't edit settings that aren't saveable in per-game config even if they are switchable
if (NativeConfig.isPerGameConfigLoaded() && !setting.isSaveable) {
return false
@@ -102,31 +88,7 @@ abstract class SettingsItem(
val clearable: Boolean
get() = !setting.global && NativeConfig.isPerGameConfigLoaded()
private val frameGenTargetRate: Int
get() {
val key = IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.key
val needsGlobal = if (NativeLibrary.isRunning() &&
!NativeConfig.isPerGameConfigLoaded()
) {
!NativeConfig.usingGlobal(key)
} else {
NativeConfig.usingGlobal(key)
}
return IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.getInt(needsGlobal)
}
companion object {
private val frameGenKeys = setOf(
BooleanSetting.RENDERER_FRAME_GEN.key,
IntSetting.RENDERER_FRAME_GEN_MULTIPLIER.key,
IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.key,
IntSetting.RENDERER_FRAME_GEN_QUEUE_TARGET.key,
BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.key,
IntSetting.RENDERER_FRAME_GEN_FLOW_SCALE.key,
BooleanSetting.RENDERER_FRAME_GEN_FP16.key,
BooleanSetting.RENDERER_FRAME_GEN_DUMP_FLOW.key
)
const val TYPE_HEADER = 0
const val TYPE_SWITCH = 1
const val TYPE_SINGLE_CHOICE = 2
@@ -645,71 +607,6 @@ abstract class SettingsItem(
valuesId = R.array.rendererAntiAliasingValues
)
)
put(
SwitchSetting(
BooleanSetting.RENDERER_FRAME_GEN,
titleId = R.string.frame_gen,
descriptionId = R.string.frame_gen_description
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_FRAME_GEN_MULTIPLIER,
titleId = R.string.frame_gen_multiplier,
descriptionId = R.string.frame_gen_multiplier_description,
choicesId = R.array.frameGenMultiplierNames,
valuesId = R.array.frameGenMultiplierValues
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_FRAME_GEN_TARGET_RATE,
titleId = R.string.frame_gen_target_rate,
descriptionId = R.string.frame_gen_target_rate_description,
choicesId = R.array.frameGenTargetRateNames,
valuesId = R.array.frameGenTargetRateValues
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_FRAME_GEN_QUEUE_TARGET,
titleId = R.string.frame_gen_queue_target,
descriptionId = R.string.frame_gen_queue_target_description,
choicesId = R.array.frameGenQueueTargetNames,
valuesId = R.array.frameGenQueueTargetValues
)
)
put(
SwitchSetting(
BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO,
titleId = R.string.frame_gen_flow_scale_auto,
descriptionId = R.string.frame_gen_flow_scale_auto_description
)
)
put(
SliderSetting(
IntSetting.RENDERER_FRAME_GEN_FLOW_SCALE,
titleId = R.string.frame_gen_flow_scale,
descriptionId = R.string.frame_gen_flow_scale_description,
min = 25,
max = 100,
units = "%"
)
)
put(
SwitchSetting(
BooleanSetting.RENDERER_FRAME_GEN_FP16,
titleId = R.string.frame_gen_fp16,
descriptionId = R.string.frame_gen_fp16_description
)
)
put(
SwitchSetting(
BooleanSetting.RENDERER_FRAME_GEN_DUMP_FLOW,
titleId = R.string.frame_gen_dump_flow,
descriptionId = R.string.frame_gen_dump_flow_description
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_SCREEN_LAYOUT,
@@ -382,9 +382,7 @@ class SettingsDialogFragment : DialogFragment(), DialogInterface.OnClickListener
}
scSetting.setSelectedValue(value)
if (scSetting.setting.key == IntSetting.RENDERER_SCALING_FILTER.key ||
scSetting.setting.key == IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.key
) {
if (scSetting.setting.key == IntSetting.RENDERER_SCALING_FILTER.key) {
settingsViewModel.setShouldReloadSettingsList(true)
}
@@ -27,7 +27,6 @@ import org.yuzu.yuzu_emu.features.settings.model.ShortSetting
import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.features.settings.model.view.*
import org.yuzu.yuzu_emu.utils.InputHandler
import org.yuzu.yuzu_emu.utils.LosslessScalingHelper
import org.yuzu.yuzu_emu.utils.NativeConfig
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.FullscreenHelper
@@ -77,41 +76,6 @@ class SettingsFragmentPresenter(
}
}
private fun addFrameGenSettings(sl: ArrayList<SettingsItem>) {
sl.apply {
if (!LosslessScalingHelper.isSupportedByGpu()) {
add(
RunnableSetting(
titleId = R.string.frame_gen_unsupported,
descriptionId = R.string.frame_gen_unsupported_description,
isRunnable = false
) {}
)
} else if (!LosslessScalingHelper.isInstalled()) {
add(
RunnableSetting(
titleId = R.string.lossless_scaling_missing,
descriptionId = R.string.lossless_scaling_missing_description,
isRunnable = false
) {}
)
}
add(BooleanSetting.RENDERER_FRAME_GEN.key)
add(IntSetting.RENDERER_FRAME_GEN_TARGET_RATE.key)
add(IntSetting.RENDERER_FRAME_GEN_MULTIPLIER.key)
add(IntSetting.RENDERER_FRAME_GEN_QUEUE_TARGET.key)
add(BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.key)
if (!BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.getBoolean(
getNeedsGlobalForKey(BooleanSetting.RENDERER_FRAME_GEN_FLOW_SCALE_AUTO.key)
)
) {
add(IntSetting.RENDERER_FRAME_GEN_FLOW_SCALE.key)
}
add(BooleanSetting.RENDERER_FRAME_GEN_FP16.key)
}
}
private fun isSharpnessScalingFilterSelected(): Boolean {
val needsGlobal = getNeedsGlobalForKey(IntSetting.RENDERER_SCALING_FILTER.key)
val selectedFilter = IntSetting.RENDERER_SCALING_FILTER.getInt(needsGlobal)
@@ -156,7 +120,6 @@ class SettingsFragmentPresenter(
MenuTag.SECTION_ROOT -> addConfigSettings(sl)
MenuTag.SECTION_SYSTEM -> addSystemSettings(sl)
MenuTag.SECTION_RENDERER -> addGraphicsSettings(sl)
MenuTag.SECTION_FRAME_GEN -> addFrameGenSettings(sl)
MenuTag.SECTION_PERFORMANCE_STATS -> addPerformanceOverlaySettings(sl)
MenuTag.SECTION_SOC_OVERLAY -> addSocOverlaySettings(sl)
MenuTag.SECTION_INPUT_OVERLAY -> addInputOverlaySettings(sl)
@@ -339,6 +302,7 @@ class SettingsFragmentPresenter(
add(BooleanSetting.SKIP_CPU_INNER_INVALIDATION.key)
add(BooleanSetting.FIX_BLOOM_EFFECTS.key)
add(BooleanSetting.EMULATE_BGR565.key)
add(BooleanSetting.RESCALE_HACK.key)
add(BooleanSetting.RENDERER_ASYNCHRONOUS_SHADERS.key)
add(IntSetting.ANDROID_PIPELINE_WORKERS.key)
add(BooleanSetting.RENDERER_ASYNCHRONOUS_GPU_EMULATION.key)
@@ -1332,7 +1296,6 @@ class SettingsFragmentPresenter(
add(BooleanSetting.DUMP_GUEST_SHADERS.key)
add(BooleanSetting.GPU_LOG_SHADER_DUMPS.key)
add(BooleanSetting.DUMP_MACROS.key)
add(BooleanSetting.RENDERER_FRAME_GEN_DUMP_FLOW.key)
add(BooleanSetting.GPU_LOG_MEMORY_TRACKING.key)
add(BooleanSetting.GPU_LOG_DRIVER_DEBUG.key)
add(IntSetting.GPU_LOG_RING_BUFFER_SIZE.key)
@@ -29,7 +29,6 @@ enum class SettingsSubscreen {
DRIVER_MANAGER,
DRIVER_FETCHER,
FREEDRENO_SETTINGS,
LOSSLESS_MANAGER,
APPLET_LAUNCHER,
INSTALLABLE,
GAME_FOLDERS,
@@ -127,7 +126,6 @@ class SettingsSubscreenActivity : AppCompatActivity() {
SettingsSubscreen.DRIVER_MANAGER -> R.id.driverManagerFragment
SettingsSubscreen.DRIVER_FETCHER -> R.id.driverFetcherFragment
SettingsSubscreen.FREEDRENO_SETTINGS -> R.id.freedrenoSettingsFragment
SettingsSubscreen.LOSSLESS_MANAGER -> R.id.losslessManagerFragment
SettingsSubscreen.APPLET_LAUNCHER -> R.id.appletLauncherFragment
SettingsSubscreen.INSTALLABLE -> R.id.installableFragment
SettingsSubscreen.GAME_FOLDERS -> R.id.gameFoldersFragment
@@ -369,21 +369,6 @@ class GamePropertiesFragment : Fragment() {
)
)
}
add(
SubmenuProperty(
R.string.frame_gen,
R.string.frame_gen_per_game_description,
R.drawable.ic_duck,
action = {
val action = HomeNavigationDirections.actionGlobalSettingsActivity(
args.game,
Settings.MenuTag.SECTION_FRAME_GEN
)
binding.root.findNavController().navigate(action)
}
)
)
if (GpuDriverHelper.isAdrenoGpu()) {
add(
SubmenuProperty(
@@ -44,7 +44,6 @@ import org.yuzu.yuzu_emu.ui.main.MainActivity
import org.yuzu.yuzu_emu.utils.FileUtil
import org.yuzu.yuzu_emu.utils.GpuDriverHelper
import org.yuzu.yuzu_emu.utils.Log
import org.yuzu.yuzu_emu.utils.LosslessScalingHelper
import org.yuzu.yuzu_emu.utils.ViewUtils.updateMargins
class HomeSettingsFragment : Fragment() {
@@ -171,24 +170,6 @@ class HomeSettingsFragment : Fragment() {
)
)
}
add(
HomeSetting(
R.string.lossless_scaling,
R.string.lossless_scaling_description,
R.drawable.ic_duck,
{
val action = HomeNavigationDirections.actionGlobalSettingsSubscreenActivity(
SettingsSubscreen.LOSSLESS_MANAGER,
null
)
binding.root.findNavController().navigate(action)
},
{ true },
0,
0,
LosslessScalingHelper.statusText
)
)
add(
HomeSetting(
R.string.multiplayer,
@@ -356,7 +337,6 @@ class HomeSettingsFragment : Fragment() {
override fun onResume() {
super.onResume()
driverViewModel.updateDriverNameForGame(null)
LosslessScalingHelper.refreshStatus()
}
override fun onDestroyView() {
@@ -1,174 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.fragments
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import com.google.android.material.transition.MaterialSharedAxis
import org.yuzu.yuzu_emu.NativeLibrary
import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.adapters.HomeSettingAdapter
import org.yuzu.yuzu_emu.databinding.FragmentLosslessManagerBinding
import org.yuzu.yuzu_emu.features.fetcher.SpacingItemDecoration
import org.yuzu.yuzu_emu.model.HomeSetting
import org.yuzu.yuzu_emu.utils.LosslessScalingHelper
import org.yuzu.yuzu_emu.utils.ViewUtils.updateMargins
import org.yuzu.yuzu_emu.utils.collect
class LosslessManagerFragment : Fragment() {
private var _binding: FragmentLosslessManagerBinding? = null
private val binding get() = _binding!!
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
returnTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
reenterTransition = MaterialSharedAxis(MaterialSharedAxis.X, false)
exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = FragmentLosslessManagerBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.toolbarLossless.setNavigationOnClickListener {
requireActivity().onBackPressedDispatcher.onBackPressed()
}
binding.losslessOptionsList.apply {
layoutManager =
GridLayoutManager(requireContext(), resources.getInteger(R.integer.grid_columns))
addItemDecoration(
SpacingItemDecoration(resources.getDimensionPixelSize(R.dimen.spacing_small))
)
}
LosslessScalingHelper.statusText.collect(viewLifecycleOwner) { refreshOptions() }
setInsets()
}
private fun refreshOptions() {
binding.losslessOptionsList.adapter = HomeSettingAdapter(
requireActivity() as AppCompatActivity,
viewLifecycleOwner,
buildOptions()
)
}
private fun buildOptions(): List<HomeSetting> {
val installed = LosslessScalingHelper.isInstalled()
return listOf(
HomeSetting(
if (installed) R.string.lossless_scaling_replace else R.string.lossless_scaling_install,
if (installed) {
R.string.lossless_scaling_replace_description
} else {
R.string.lossless_scaling_install_description
},
R.drawable.ic_install,
{ dllPickerLauncher.launch(arrayOf("*/*")) },
{ !NativeLibrary.isRunning() },
R.string.lossless_scaling_locked,
R.string.lossless_scaling_locked_description,
LosslessScalingHelper.statusText
),
HomeSetting(
R.string.lossless_scaling_remove,
R.string.lossless_scaling_remove_description,
R.drawable.ic_delete,
{ confirmRemoval() },
{ installed && !NativeLibrary.isRunning() },
if (installed) {
R.string.lossless_scaling_locked
} else {
R.string.lossless_scaling_remove_unavailable
},
if (installed) {
R.string.lossless_scaling_locked_description
} else {
R.string.lossless_scaling_remove_unavailable_description
}
)
)
}
private fun confirmRemoval() {
MessageDialogFragment.newInstance(
requireActivity(),
titleId = R.string.lossless_scaling_remove,
descriptionId = R.string.lossless_scaling_remove_confirmation,
positiveButtonTitleId = R.string.lossless_scaling_remove,
positiveAction = { LosslessScalingHelper.remove() },
showNegativeButton = true,
negativeAction = {}
).show(parentFragmentManager, MessageDialogFragment.TAG)
}
private val dllPickerLauncher =
registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
if (result == null) {
return@registerForActivityResult
}
val resultStrings = resources.getStringArray(R.array.losslessDllResults)
ProgressDialogFragment.newInstance(
requireActivity(),
R.string.lossless_scaling_installing,
false
) { _, _ ->
val installResult = LosslessScalingHelper.install(result)
if (installResult == LosslessScalingHelper.RESULT_OK) {
getString(R.string.lossless_scaling_install_success)
} else {
MessageDialogFragment.newInstance(
titleId = R.string.lossless_scaling_install_failed,
descriptionString = resultStrings[installResult]
)
}
}.show(parentFragmentManager, ProgressDialogFragment.TAG)
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
private fun setInsets() =
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _, windowInsets ->
val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout())
binding.appbarLossless.updateMargins(
left = barInsets.left + cutoutInsets.left,
right = barInsets.right + cutoutInsets.right
)
binding.scrollViewLossless.updatePadding(bottom = barInsets.bottom)
binding.losslessOptionsList.updatePadding(
left = barInsets.left + cutoutInsets.left,
right = barInsets.right + cutoutInsets.right
)
windowInsets
}
}
@@ -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
package org.yuzu.yuzu_emu.fragments
@@ -42,7 +42,6 @@ import org.yuzu.yuzu_emu.model.SetupPage
import org.yuzu.yuzu_emu.model.PageState
import org.yuzu.yuzu_emu.ui.main.MainActivity
import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.LosslessScalingHelper
import org.yuzu.yuzu_emu.utils.NativeConfig
import org.yuzu.yuzu_emu.utils.ViewUtils
import org.yuzu.yuzu_emu.utils.ViewUtils.setVisible
@@ -203,24 +202,6 @@ class SetupFragment : Fragment() {
R.string.install_firmware_warning_help,
)
)
add(
PageButton(
R.drawable.ic_duck,
R.string.lossless_scaling,
R.string.lossless_scaling_setup_description,
{
pageButtonCallback = it
getLosslessDll.launch(arrayOf("*/*"))
},
{
if (LosslessScalingHelper.isInstalled()) {
ButtonState.BUTTON_ACTION_COMPLETE
} else {
ButtonState.BUTTON_ACTION_INCOMPLETE
}
}
)
)
add(
PageButton(
R.drawable.ic_controller,
@@ -465,32 +446,6 @@ class SetupFragment : Fragment() {
}
}
val getLosslessDll =
registerForActivityResult(ActivityResultContracts.OpenDocument()) { result ->
if (result == null) {
return@registerForActivityResult
}
val resultStrings = resources.getStringArray(R.array.losslessDllResults)
ProgressDialogFragment.newInstance(
requireActivity(),
R.string.lossless_scaling_installing,
false
) { _, _ ->
val installResult = LosslessScalingHelper.install(result)
if (installResult == LosslessScalingHelper.RESULT_OK) {
getString(R.string.lossless_scaling_install_success)
} else {
MessageDialogFragment.newInstance(
titleId = R.string.lossless_scaling_install_failed,
descriptionString = resultStrings[installResult]
)
}
}.apply {
onDialogComplete = { checkForButtonState.invoke() }
}.show(parentFragmentManager, ProgressDialogFragment.TAG)
}
val getGamesDirectory =
registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { result ->
if (result != null) {
@@ -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
package org.yuzu.yuzu_emu.fragments
@@ -72,18 +72,6 @@ class SystemInfoDialogFragment : DialogFragment() {
val vulkanDriver = NativeLibrary.getVulkanDriverVersion()
appendLine("${getString(R.string.vulkan_driver_version)}: $vulkanDriver")
val frameGen = NativeLibrary.supportsFrameGeneration()
appendLine(
"${getString(R.string.frame_generation_support)}: " +
getString(
if (frameGen) {
R.string.frame_generation_supported
} else {
R.string.frame_generation_unsupported
}
)
)
} catch (e: Exception) {
appendLine("${getString(R.string.error_getting_emulator_info)}: ${e.message}")
}
@@ -1,77 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
package org.yuzu.yuzu_emu.utils
import android.net.Uri
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import org.yuzu.yuzu_emu.NativeLibrary
import org.yuzu.yuzu_emu.R
import org.yuzu.yuzu_emu.YuzuApplication
import java.io.File
object LosslessScalingHelper {
const val RESULT_OK = 0
const val RESULT_NOT_INSTALLED = 1
private val _statusText = MutableStateFlow("")
val statusText: StateFlow<String> = _statusText.asStateFlow()
private var installed: Boolean? = null
private var gpuSupported: Boolean? = null
fun isInstalled(): Boolean = installed ?: refreshStatus()
fun isSupportedByGpu(): Boolean {
val cached = gpuSupported
if (cached != null) {
return cached
}
val result = NativeLibrary.supportsFrameGeneration()
gpuSupported = result
return result
}
fun refreshStatus(): Boolean {
val result = NativeLibrary.validateLosslessDll() == RESULT_OK
installed = result
val context = YuzuApplication.appContext
_statusText.value = if (result) {
context.getString(R.string.lossless_scaling_installed)
} else {
context.getString(R.string.lossless_scaling_not_installed)
}
return result
}
fun install(source: Uri): Int {
val destination = File(NativeLibrary.getLosslessDllPath())
destination.parentFile?.mkdirs()
val copied = FileUtil.copyUriToInternalStorage(
source,
destination.parent!!,
destination.name
)
if (copied == null) {
refreshStatus()
return RESULT_NOT_INSTALLED
}
val result = NativeLibrary.prepareLosslessDll()
if (result != RESULT_OK) {
NativeLibrary.removeLosslessDll()
}
refreshStatus()
return result
}
fun remove(): Boolean {
val removed = NativeLibrary.removeLosslessDll()
refreshStatus()
return removed
}
}
@@ -33,8 +33,8 @@ void AndroidConfig::SaveAllValues() {
}
void AndroidConfig::ReadAndroidValues() {
ReadAndroidUIValues();
if (global) {
ReadAndroidUIValues();
ReadUIValues();
BeginGroup(Settings::TranslateCategory(Settings::Category::DataStorage));
Settings::values.ext_content_from_game_dirs = ReadBooleanSetting(
@@ -223,8 +223,8 @@ void AndroidConfig::ReadAndroidControlValues() {
}
void AndroidConfig::SaveAndroidValues() {
SaveAndroidUIValues();
if (global) {
SaveAndroidUIValues();
SaveUIValues();
SaveOverlayValues();
}
@@ -147,7 +147,7 @@ namespace AndroidSettings {
&show_performance_overlay};
Settings::SwitchableSetting<s32> pipeline_worker_count{linkage, 2, "pipeline_worker_count",
Settings::Setting<s32> pipeline_worker_count{linkage, 4, "pipeline_worker_count",
Settings::Category::Android,
Settings::Specialization::Default,
true,
@@ -124,18 +124,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<float>(std::clamp<u32>(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();
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,9 +150,9 @@ float EmuWindow_Android::GetFrameRateHint() const {
return frame_time_verified_hint;
}
const float nominal_rate = 60.0f * presented_multiplier;
constexpr float NominalFrameRate = 60.0f;
if (!Settings::values.use_speed_limit.GetValue()) {
return QuantizeFrameRateHint(nominal_rate);
return NominalFrameRate;
}
const u16 speed_limit = Settings::SpeedLimit();
@@ -170,7 +161,7 @@ float EmuWindow_Android::GetFrameRateHint() const {
}
const float speed_limited_rate =
nominal_rate * (static_cast<float>(std::min<u16>(speed_limit, 100)) / 100.0f);
NominalFrameRate * (static_cast<float>(std::min<u16>(speed_limit, 100)) / 100.0f);
return QuantizeFrameRateHint(speed_limited_rate);
}
@@ -61,7 +61,6 @@ private:
void UpdateObservedFrameRate();
[[nodiscard]] float GetFrameRateHint() const;
[[nodiscard]] float GetFrameTimeVerifiedHint() const;
[[nodiscard]] static float GetPresentedFrameMultiplier();
[[nodiscard]] static float QuantizeFrameRateHint(float frame_rate);
float m_window_width{};
-71
View File
@@ -44,7 +44,6 @@ extern "C" {
#include "common/android/android_common.h"
#include "common/android/id_cache.h"
#include "common/dynamic_library.h"
#include "common/fs/fs_util.h"
#include "common/fs/path_util.h"
#include "common/logging.h"
#include "common/scm_rev.h"
@@ -91,7 +90,6 @@ extern "C" {
#include "hid_core/hid_types.h"
#include "input_common/drivers/virtual_amiibo.h"
#include "jni/native.h"
#include "video_core/frame_gen/lossless_dll.h"
#include "video_core/renderer_base.h"
#include "video_core/renderer_vulkan/renderer_vulkan.h"
#include "video_core/capture.h"
@@ -1092,34 +1090,6 @@ VkPhysicalDeviceProperties GetVulkanDeviceProperties() {
const Vulkan::vk::PhysicalDevice physical_device(physical_devices[0], dld);
return physical_device.GetProperties();
}
bool GetVulkanMemoryModelSupport() {
Common::DynamicLibrary library;
if (!library.Open("libvulkan.so")) {
return false;
}
Vulkan::vk::InstanceDispatch dld;
const auto instance = Vulkan::CreateInstance(library, dld, VK_API_VERSION_1_1);
const auto physical_devices = instance.EnumeratePhysicalDevices();
if (physical_devices.empty()) {
return false;
}
const Vulkan::vk::PhysicalDevice physical_device(physical_devices[0], dld);
VkPhysicalDeviceVulkanMemoryModelFeatures memory_model{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES,
.pNext = nullptr,
};
VkPhysicalDeviceFeatures2 features{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
.pNext = &memory_model,
};
physical_device.GetFeatures2(features);
return memory_model.vulkanMemoryModel == VK_TRUE;
}
} // namespace
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getVulkanDriverVersion(JNIEnv* env, jobject jobj) {
@@ -1195,14 +1165,6 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getVulkanApiVersion(JNIEnv* env, j
}
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_supportsFrameGeneration(JNIEnv* env, jobject jobj) {
try {
return static_cast<jboolean>(GetVulkanMemoryModelSupport());
} catch (...) {
return static_cast<jboolean>(false);
}
}
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGpuModel(JNIEnv* env, jobject jobj) {
const auto props = GetVulkanDeviceProperties();
if (props.deviceID == 0) {
@@ -1428,39 +1390,6 @@ jint Java_org_yuzu_yuzu_1emu_NativeLibrary_installKeys(JNIEnv* env, jclass clazz
return static_cast<int>(FirmwareManager::InstallKeys(path, ext));
}
jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getLosslessDllPath(JNIEnv* env, jclass clazz) {
#ifdef HAS_LSFG
const auto path = VideoCore::FrameGen::GetLosslessDllPath();
return Common::Android::ToJString(env, Common::FS::PathToUTF8String(path));
#else
return Common::Android::ToJString(env, "");
#endif
}
jint Java_org_yuzu_yuzu_1emu_NativeLibrary_validateLosslessDll(JNIEnv* env, jclass clazz) {
#ifdef HAS_LSFG
return static_cast<jint>(VideoCore::FrameGen::GetInstalledLosslessStatus());
#else
return static_cast<jint>(VideoCore::FrameGen::LosslessStatus::NotInstalled);
#endif
}
jint Java_org_yuzu_yuzu_1emu_NativeLibrary_prepareLosslessDll(JNIEnv* env, jclass clazz) {
#ifdef HAS_LSFG
return static_cast<jint>(VideoCore::FrameGen::BuildShaderCache());
#else
return static_cast<jint>(VideoCore::FrameGen::LosslessStatus::NotInstalled);
#endif
}
jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_removeLosslessDll(JNIEnv* env, jclass clazz) {
#ifdef HAS_LSFG
return static_cast<jboolean>(VideoCore::FrameGen::RemoveInstalledLosslessDll());
#else
return static_cast<jboolean>(false);
#endif
}
jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPatchesForFile(JNIEnv* env, jobject jobj,
jstring jpath,
jstring jprogramId) {
@@ -1,19 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M11,10.6a8,5.2 0 1,0 0,10.4a8,5.2 0 1,0 0,-10.4z" />
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M4.6,12.6L0.8,10.2L3.2,15.5z" />
<path
android:fillColor="?attr/colorControlNormal"
android:fillType="evenOdd"
android:pathData="M15.3,3.5a4,4 0 1,0 0,8a4,4 0 1,0 0,-8zM16.6,4.9a1,1 0 1,0 0,2a1,1 0 1,0 0,-2z" />
<path
android:fillColor="?attr/colorControlNormal"
android:pathData="M18.6,6.5L23.2,7.8L18.6,9.3z" />
</vector>
@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_lossless"
style="@style/Widget.Eden.TransparentTopAppBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:touchscreenBlocksFocus="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_lossless"
style="@style/Widget.Eden.TransparentTopToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:touchscreenBlocksFocus="false"
app:navigationIcon="@drawable/ic_back"
app:title="@string/lossless_scaling" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/scroll_view_lossless"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
android:clipToPadding="false"
android:defaultFocusHighlightEnabled="false"
android:fadeScrollbars="false"
android:scrollbars="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/appbar_lossless">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingTop="16dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/lossless_options_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:nestedScrollingEnabled="false" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -47,12 +47,6 @@
android:defaultValue="@null" />
</fragment>
<fragment
android:id="@+id/losslessManagerFragment"
android:name="org.yuzu.yuzu_emu.fragments.LosslessManagerFragment"
android:label="@string/lossless_scaling"
tools:layout="@layout/fragment_lossless_manager" />
<fragment
android:id="@+id/appletLauncherFragment"
android:name="org.yuzu.yuzu_emu.fragments.AppletLauncherFragment"
@@ -162,48 +162,6 @@
<item>@string/resolution_four</item>
</string-array>
<string-array name="frameGenMultiplierNames">
<item>@string/frame_gen_multiplier_2x</item>
<item>@string/frame_gen_multiplier_3x</item>
<item>@string/frame_gen_multiplier_4x</item>
</string-array>
<integer-array name="frameGenMultiplierValues">
<item>2</item>
<item>3</item>
<item>4</item>
</integer-array>
<string-array name="frameGenTargetRateNames">
<item>@string/frame_gen_target_rate_off</item>
<item>@string/frame_gen_target_rate_60</item>
<item>@string/frame_gen_target_rate_90</item>
<item>@string/frame_gen_target_rate_120</item>
<item>@string/frame_gen_target_rate_144</item>
<item>@string/frame_gen_target_rate_165</item>
</string-array>
<integer-array name="frameGenTargetRateValues">
<item>0</item>
<item>60</item>
<item>90</item>
<item>120</item>
<item>144</item>
<item>165</item>
</integer-array>
<string-array name="frameGenQueueTargetNames">
<item>@string/frame_gen_queue_target_0</item>
<item>@string/frame_gen_queue_target_1</item>
<item>@string/frame_gen_queue_target_2</item>
</string-array>
<integer-array name="frameGenQueueTargetValues">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
<string-array name="rendererVSyncNames">
<item>@string/renderer_vsync_immediate</item>
<item>@string/renderer_vsync_mailbox</item>
@@ -680,16 +638,6 @@
<item>@string/error_keys_failed_init</item>
</string-array>
<string-array name="losslessDllResults">
<item>""</item>
<item>@string/error_lossless_copy_failed</item>
<item>@string/error_lossless_unreadable</item>
<item>@string/error_lossless_not_pe</item>
<item>@string/error_lossless_missing_shaders</item>
<item>@string/error_lossless_translation_failed</item>
<item>@string/error_lossless_cache_failed</item>
</string-array>
<!-- GPU Logging Arrays -->
<string-array name="gpuLogLevelEntries">
<item>Off</item>
@@ -298,67 +298,6 @@
<string name="gpu_driver_fetcher">GPU driver fetcher</string>
<string name="gpu_driver_manager">GPU driver manager</string>
<string name="install_gpu_driver_description">Install alternative drivers for potentially better performance or accuracy</string>
<string name="frame_gen">Frame generation</string>
<string name="frame_gen_per_game_description">Configure frame generation for this game</string>
<string name="frame_gen_description">Insert interpolated frames between rendered ones using Lossless Scaling. Forces FIFO presentation while enabled.</string>
<string name="frame_gen_multiplier">Frame multiplier</string>
<string name="frame_gen_multiplier_description">How many frames to display for each rendered frame. Higher values cost proportionally more GPU time. Asking for more than your display can present will slow emulation down.</string>
<string name="frame_gen_multiplier_2x">2x</string>
<string name="frame_gen_multiplier_3x">3x</string>
<string name="frame_gen_multiplier_4x">4x</string>
<string name="frame_gen_target_rate">Target frame rate</string>
<string name="frame_gen_target_rate_description">Pick the rate your display can actually show. The multiplier then rises or falls on its own to hold it, and rolls back any step that makes the game itself run slower.</string>
<string name="frame_gen_target_rate_off">Use a fixed multiplier</string>
<string name="frame_gen_target_rate_60">60 FPS</string>
<string name="frame_gen_target_rate_90">90 FPS</string>
<string name="frame_gen_target_rate_120">120 FPS</string>
<string name="frame_gen_target_rate_144">144 FPS</string>
<string name="frame_gen_target_rate_165">165 FPS</string>
<string name="frame_gen_queue_target">Frame queue target</string>
<string name="frame_gen_queue_target_description">How many finished frames may wait ahead of the display. Larger queues absorb GPU spikes at the cost of input latency.</string>
<string name="frame_gen_queue_target_0">Lowest latency (Unbuffered)</string>
<string name="frame_gen_queue_target_1">Balanced (1 frame)</string>
<string name="frame_gen_queue_target_2">Smoothest (2 frames)</string>
<string name="frame_gen_flow_scale_auto">Match motion estimation to the game</string>
<string name="frame_gen_flow_scale_auto_description">Estimate motion at the resolution the game actually renders instead of the upscaled output. Costs nothing in accuracy, since upscaling adds no motion detail.</string>
<string name="frame_gen_flow_scale">Motion estimation resolution</string>
<string name="frame_gen_flow_scale_description">Resolution of the optical flow pass, as a fraction of the output. Lowering it is the cheapest way to reclaim performance.</string>
<string name="frame_gen_fp16">Half precision shaders</string>
<string name="frame_gen_fp16_description">Use the 16-bit shader variant. Falls back automatically if the driver or the file lacks it.</string>
<string name="frame_gen_dump_flow">Dump generated frame</string>
<string name="frame_gen_dump_flow_description">Write the optical flow mip levels and the interpolated frame to the lossless/debug folder once, for troubleshooting</string>
<string name="frame_gen_unsupported">Frame generation unavailable</string>
<string name="frame_gen_unsupported_description">This GPU driver does not support the Vulkan memory model, which the Lossless Scaling shaders require.</string>
<string name="lossless_scaling_setup_description">Optional. Provide your own Lossless.dll to enable frame generation later</string>
<string name="lossless_scaling_install">Install Lossless.dll</string>
<string name="lossless_scaling_install_description">Frame generation needs your own legal copy of Lossless.dll from Lossless Scaling</string>
<string name="lossless_scaling_replace_description">Select a different copy of Lossless.dll</string>
<string name="frame_generation_support">Frame generation</string>
<string name="frame_generation_supported">Supported</string>
<string name="frame_generation_unsupported">Unsupported (no Vulkan memory model)</string>
<string name="lossless_scaling">Lossless Scaling</string>
<string name="lossless_scaling_description">Provide your own copy of Lossless.dll to enable frame generation</string>
<string name="lossless_scaling_installed">Installed</string>
<string name="lossless_scaling_not_installed">Not installed</string>
<string name="lossless_scaling_replace">Replace</string>
<string name="lossless_scaling_remove">Remove</string>
<string name="lossless_scaling_remove_description">Delete the installed Lossless.dll and its prepared shaders</string>
<string name="lossless_scaling_remove_confirmation">Frame generation will stop working until you install Lossless.dll again. Your original file is not affected.</string>
<string name="lossless_scaling_missing">Lossless.dll not installed</string>
<string name="lossless_scaling_missing_description">Install it from Settings Lossless Scaling to use frame generation.</string>
<string name="lossless_scaling_locked">Close the game first</string>
<string name="lossless_scaling_locked_description">Lossless.dll cannot be changed while a game is running.</string>
<string name="lossless_scaling_remove_unavailable">Nothing to remove</string>
<string name="lossless_scaling_remove_unavailable_description">Lossless.dll is not installed yet.</string>
<string name="lossless_scaling_installing">Preparing frame generation shaders…</string>
<string name="lossless_scaling_install_success">Lossless.dll installed successfully</string>
<string name="lossless_scaling_install_failed">Could not install Lossless.dll</string>
<string name="error_lossless_copy_failed">The selected file could not be copied.</string>
<string name="error_lossless_unreadable">The selected file could not be read.</string>
<string name="error_lossless_not_pe">The selected file is not a Windows library. Select Lossless.dll from your Lossless Scaling installation.</string>
<string name="error_lossless_missing_shaders">This copy of Lossless.dll does not contain the frame generation shaders. Update Lossless Scaling and try again.</string>
<string name="error_lossless_translation_failed">The frame generation shaders could not be translated. This version of Lossless Scaling is not supported yet.</string>
<string name="error_lossless_cache_failed">The translated shaders could not be written to storage. Check that there is free space available.</string>
<string name="advanced_settings">Advanced settings</string>
<string name="settings_description">Configure emulator settings</string>
<string name="search_recently_played">Recently played</string>
+1 -4
View File
@@ -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 2021 yuzu Emulator Project
@@ -20,7 +20,6 @@
#define KEYS_DIR "keys"
#define LOAD_DIR "load"
#define LOG_DIR "log"
#define LOSSLESS_DIR "lossless"
#define NAND_DIR "nand"
#define PLAY_TIME_DIR "play_time"
#define SCREENSHOTS_DIR "screenshots"
@@ -38,5 +37,3 @@
// yuzu-specific files
#define LOG_FILE "eden_log.txt"
#define LOSSLESS_DLL_FILE "Lossless.dll"
#define LOSSLESS_CACHE_FILE "lsfg_spirv.cache"
-1
View File
@@ -157,7 +157,6 @@ public:
GenerateEdenPath(EdenPath::KeysDir, eden_path / KEYS_DIR);
GenerateEdenPath(EdenPath::LoadDir, eden_path / LOAD_DIR);
GenerateEdenPath(EdenPath::LogDir, eden_path / LOG_DIR);
GenerateEdenPath(EdenPath::LosslessDir, eden_path / LOSSLESS_DIR);
GenerateEdenPath(EdenPath::NANDDir, eden_path / NAND_DIR);
GenerateEdenPath(EdenPath::PlayTimeDir, eden_path / PLAY_TIME_DIR);
GenerateEdenPath(EdenPath::SaveDir, eden_path / NAND_DIR);
+1 -2
View File
@@ -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 2021 yuzu Emulator Project
@@ -23,7 +23,6 @@ enum class EdenPath {
KeysDir, // Where key files are stored.
LoadDir, // Where cheat/mod files are stored.
LogDir, // Where log files are stored.
LosslessDir, // Where the user-supplied Lossless Scaling library is stored.
NANDDir, // Where the emulated NAND is stored.
PlayTimeDir, // Where play time data is stored.
SaveDir, // Where save data is stored.
-22
View File
@@ -380,28 +380,6 @@ void UpdateRescalingInfo() {
TranslateResolutionInfo(setup, info);
}
u32 FrameGenMultiplier() {
return std::clamp(values.frame_gen_multiplier.GetValue(), MIN_FRAME_GEN_MULTIPLIER,
MAX_FRAME_GEN_MULTIPLIER);
}
size_t FrameGenGenerations() {
if (!values.frame_gen.GetValue()) {
return 0;
}
return FrameGenMultiplier() - 1;
}
size_t FrameGenMaxGenerations() {
if (!values.frame_gen.GetValue()) {
return 0;
}
if (values.frame_gen_target_rate.GetValue() != 0) {
return MAX_FRAME_GEN_MULTIPLIER - 1;
}
return FrameGenMultiplier() - 1;
}
void RestoreGlobalState(bool is_powered_on) {
// If a game is running, DO NOT restore the global settings state
if (is_powered_on) {
+8 -76
View File
@@ -352,7 +352,7 @@ struct Values {
true};
SwitchableSetting<ScalingFilter> scaling_filter{linkage,
ScalingFilter::NearestNeighbor,
ScalingFilter::Bilinear,
"scaling_filter",
Category::Renderer,
Specialization::Default,
@@ -388,69 +388,6 @@ struct Values {
true,
true};
SwitchableSetting<bool> frame_gen{linkage, false, "frame_gen", Category::Renderer,
Specialization::Default, true, false};
SwitchableSetting<u32, true> frame_gen_multiplier{linkage,
2,
2,
4,
"frame_gen_multiplier",
Category::Renderer,
Specialization::Countable,
true,
false,
&frame_gen};
SwitchableSetting<u32, true> frame_gen_target_rate{linkage,
0,
0,
240,
"frame_gen_target_rate",
Category::Renderer,
Specialization::Countable,
true,
true,
&frame_gen};
SwitchableSetting<bool> frame_gen_flow_scale_auto{linkage,
true,
"frame_gen_flow_scale_auto",
Category::Renderer,
Specialization::Default,
true,
false,
&frame_gen};
SwitchableSetting<u32, true> frame_gen_flow_scale{linkage,
75,
25,
100,
"frame_gen_flow_scale",
Category::Renderer,
Specialization::Countable |
Specialization::Percentage,
true,
true,
&frame_gen};
SwitchableSetting<u32, true> frame_gen_queue_target{linkage,
1,
0,
2,
"frame_gen_queue_target",
Category::Renderer,
Specialization::Countable,
true,
false,
&frame_gen};
SwitchableSetting<bool> frame_gen_fp16{linkage, true, "frame_gen_fp16", Category::Renderer,
Specialization::Default, true, false, &frame_gen};
SwitchableSetting<bool> frame_gen_dump_flow{linkage, false, "frame_gen_dump_flow",
Category::Renderer};
SwitchableSetting<bool> use_asynchronous_gpu_emulation{linkage,
#ifdef __ANDROID__
false,
@@ -632,8 +569,13 @@ struct Values {
SwitchableSetting<bool> emulate_bgr565{linkage, false, "emulate_bgr565",
Category::RendererHacks};
SwitchableSetting<bool> rescale_hack{linkage, false, "rescale_hack",
Category::RendererHacks};
SwitchableSetting<bool> rescale_hack{linkage,
#ifdef __ANDROID__
true,
#else
false,
#endif
"rescale_hack", Category::RendererHacks};
SwitchableSetting<bool> enable_gpu_buffer_readback{linkage,
false,
"enable_gpu_buffer_readback",
@@ -933,20 +875,10 @@ struct Values {
// Per-game overrides
bool use_squashed_iterated_blend;
};
extern Values values;
constexpr u32 MIN_FRAME_GEN_MULTIPLIER = 2;
constexpr u32 MAX_FRAME_GEN_MULTIPLIER = 4;
[[nodiscard]] u32 FrameGenMultiplier();
[[nodiscard]] size_t FrameGenGenerations();
[[nodiscard]] size_t FrameGenMaxGenerations();
bool getDebugKnobAt(u8 i);
void UpdateGPUAccuracy();
+6 -10
View File
@@ -388,14 +388,6 @@ add_library(core STATIC
hle/result.h
hle/service/acc/acc.cpp
hle/service/acc/acc.h
hle/service/acc/acc_aa.cpp
hle/service/acc/acc_aa.h
hle/service/acc/acc_su.cpp
hle/service/acc/acc_su.h
hle/service/acc/acc_u0.cpp
hle/service/acc/acc_u0.h
hle/service/acc/acc_u1.cpp
hle/service/acc/acc_u1.h
hle/service/acc/async_context.cpp
hle/service/acc/async_context.h
hle/service/acc/errors.h
@@ -768,8 +760,8 @@ add_library(core STATIC
hle/service/mii/types/ver3_store_data.h
hle/service/mm/mm_u.cpp
hle/service/mm/mm_u.h
hle/service/mnpp/mnpp_app.cpp
hle/service/mnpp/mnpp_app.h
hle/service/mnpp/mnpp.cpp
hle/service/mnpp/mnpp.h
hle/service/ncm/ncm.cpp
hle/service/ncm/ncm.h
hle/service/nfc/common/amiibo_crypto.cpp
@@ -1089,6 +1081,8 @@ add_library(core STATIC
hle/service/ssl/ssl.h
hle/service/ssl/ssl_backend.h
hle/service/ssl/ssl_types.h
hle/service/tma/tma.cpp
hle/service/tma/tma.h
hle/service/usb/usb.cpp
hle/service/usb/usb.h
hle/service/vi/application_display_service.cpp
@@ -1125,6 +1119,8 @@ add_library(core STATIC
hle/service/gpio/gpio.h
hle/service/i2c/i2c.cpp
hle/service/i2c/i2c.h
hle/service/wlan/wlan.cpp
hle/service/wlan/wlan.h
internal_network/emu_net_state.cpp
internal_network/emu_net_state.h
internal_network/network.cpp
+405 -12
View File
@@ -21,10 +21,6 @@
#include "core/file_sys/control_metadata.h"
#include "core/file_sys/patch_manager.h"
#include "core/hle/service/acc/acc.h"
#include "core/hle/service/acc/acc_aa.h"
#include "core/hle/service/acc/acc_su.h"
#include "core/hle/service/acc/acc_u0.h"
#include "core/hle/service/acc/acc_u1.h"
#include "core/hle/service/acc/async_context.h"
#include "core/hle/service/acc/errors.h"
#include "core/hle/service/acc/profile_manager.h"
@@ -1244,19 +1240,416 @@ Module::Interface::Interface(std::shared_ptr<Module> module_,
Module::Interface::~Interface() = default;
class ACC_AA final : public Module::Interface {
public:
explicit ACC_AA(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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);
}
~ACC_AA() override = default;
};
class ACC_SU final : public Module::Interface {
public:
explicit ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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
RegisterHandlers(functions);
}
~ACC_SU() override = default;
};
class ACC_U0 final : public Module::Interface {
public:
ACC_U0(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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
RegisterHandlers(functions);
}
~ACC_U0() override = default;
};
class ACC_U1 final : public Module::Interface {
public:
ACC_U1(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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::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
RegisterHandlers(functions);
}
~ACC_U1() override = default;
};
class DAUTH_0 final : public ServiceFramework<DAUTH_0> {
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);
}
};
class ACC_E final : public Module::Interface {
public:
explicit ACC_E(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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);
}
};
class ACC_E_U1 final : public Module::Interface {
public:
explicit ACC_E_U1(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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);
}
};
class ACC_E_U2 final : public Module::Interface {
public:
explicit ACC_E_U2(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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);
}
};
void LoopProcess(Core::System& system) {
auto module = std::make_shared<Module>();
auto profile_manager = std::make_shared<ProfileManager>();
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("acc:aa",
std::make_shared<ACC_AA>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:su",
std::make_shared<ACC_SU>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:u0",
std::make_shared<ACC_U0>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:u1",
std::make_shared<ACC_U1>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:aa", std::make_shared<ACC_AA>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:su", std::make_shared<ACC_SU>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:u0", std::make_shared<ACC_U0>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:u1", std::make_shared<ACC_U1>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:e", std::make_shared<ACC_E>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:e:u1", std::make_shared<ACC_E_U1>(module, profile_manager, system));
server_manager->RegisterNamedService("acc:e:u2", std::make_shared<ACC_E_U2>(module, profile_manager, system));
server_manager->RegisterNamedService("dauth:0", std::make_shared<DAUTH_0>(system));
ServerManager::RunServer(std::move(server_manager));
}
-25
View File
@@ -1,25 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/acc/acc_aa.h"
namespace Service::Account {
ACC_AA::ACC_AA(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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);
}
ACC_AA::~ACC_AA() = default;
} // namespace Service::Account
-17
View File
@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
class ACC_AA final : public Module::Interface {
public:
explicit ACC_AA(std::shared_ptr<Module> module_,
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_);
~ACC_AA() override;
};
} // namespace Service::Account
-83
View File
@@ -1,83 +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/hle/service/acc/acc_su.h"
namespace Service::Account {
ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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+
{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
RegisterHandlers(functions);
}
ACC_SU::~ACC_SU() = default;
} // namespace Service::Account
-17
View File
@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
class ACC_SU final : public Module::Interface {
public:
explicit ACC_SU(std::shared_ptr<Module> module_,
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_);
~ACC_SU() override;
};
} // namespace Service::Account
-49
View File
@@ -1,49 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2025 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/acc/acc_u0.h"
namespace Service::Account {
ACC_U0::ACC_U0(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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
RegisterHandlers(functions);
}
ACC_U0::~ACC_U0() = default;
} // namespace Service::Account
-17
View File
@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
class ACC_U0 final : public Module::Interface {
public:
explicit ACC_U0(std::shared_ptr<Module> module_,
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_);
~ACC_U0() override;
};
} // namespace Service::Account
-59
View File
@@ -1,59 +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/hle/service/acc/acc_u1.h"
namespace Service::Account {
ACC_U1::ACC_U1(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> 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::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
RegisterHandlers(functions);
}
ACC_U1::~ACC_U1() = default;
} // namespace Service::Account
-17
View File
@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/acc/acc.h"
namespace Service::Account {
class ACC_U1 final : public Module::Interface {
public:
explicit ACC_U1(std::shared_ptr<Module> module_,
std::shared_ptr<ProfileManager> profile_manager_, Core::System& system_);
~ACC_U1() override;
};
} // namespace Service::Account
+12 -15
View File
@@ -26,8 +26,7 @@ Controller::Controller(Core::Timing::CoreTiming& core_timing_)
Controller::~Controller() = default;
void Controller::SetPerformanceConfiguration(PerformanceMode mode,
PerformanceConfiguration config) {
void Controller::SetPerformanceConfiguration(PerformanceMode mode, PerformanceConfiguration config) {
static constexpr std::array<std::pair<PerformanceConfiguration, u32>, 16> config_to_speed{{
{PerformanceConfiguration::Config1, 1020},
{PerformanceConfiguration::Config2, 1020},
@@ -46,17 +45,14 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode,
{PerformanceConfiguration::Config15, 1020},
{PerformanceConfiguration::Config16, 1020},
}};
const auto iter = std::find_if(config_to_speed.cbegin(), config_to_speed.cend(),
[config](const auto& entry) { return entry.first == config; });
if (iter == config_to_speed.cend()) {
if (auto const it = std::find_if(config_to_speed.cbegin(), config_to_speed.cend(), [config](const auto& e) {
return e.first == config;
}); it != config_to_speed.cend()) {
SetClockSpeed(it->second);
configs.insert_or_assign(mode, config);
} else {
LOG_ERROR(Service_APM, "Invalid performance configuration value provided: {}", config);
return;
}
SetClockSpeed(iter->second);
configs.insert_or_assign(mode, config);
}
void Controller::SetFromCpuBoostMode(CpuBoostMode mode) {
@@ -65,9 +61,11 @@ void Controller::SetFromCpuBoostMode(CpuBoostMode mode) {
PerformanceConfiguration::Config13,
PerformanceConfiguration::Config15,
}};
SetPerformanceConfiguration(PerformanceMode::Boost,
BOOST_MODE_TO_CONFIG_MAP.at(static_cast<u32>(mode)));
if (u32(mode) < BOOST_MODE_TO_CONFIG_MAP.size()) {
SetPerformanceConfiguration(PerformanceMode::Boost, BOOST_MODE_TO_CONFIG_MAP[u32(mode)]);
} else {
LOG_ERROR(Service_APM, "{} invalid mode", mode);
}
}
PerformanceMode Controller::GetCurrentPerformanceMode() const {
@@ -78,7 +76,6 @@ PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(Performa
if (configs.find(mode) == configs.end()) {
configs.insert_or_assign(mode, DEFAULT_PERFORMANCE_CONFIGURATION);
}
return configs[mode];
}
+176
View File
@@ -18,16 +18,192 @@
namespace Service::Audio {
class IAudioOutManagerForApplet final : public ServiceFramework<IAudioOutManagerForApplet> {
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);
}
};
class IAudioSnoopManager final : public ServiceFramework<IAudioSnoopManager> {
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);
}
};
class IAudioInManagerForApplet final : public ServiceFramework<IAudioInManagerForApplet> {
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);
}
};
class IAudioRendererManagerForApplet final : public ServiceFramework<IAudioRendererManagerForApplet> {
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);
}
};
class IAudioOutManagerForDebugger final : public ServiceFramework<IAudioOutManagerForDebugger> {
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);
}
};
class IAudioInManagerForDebugger final : public ServiceFramework<IAudioInManagerForDebugger> {
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);
}
};
class IFinalOutputRecorderManagerForDebugger final : public ServiceFramework<IFinalOutputRecorderManagerForDebugger> {
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);
}
};
class IAudioRendererManagerForDebugger final : public ServiceFramework<IAudioRendererManagerForDebugger> {
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);
}
};
class IAudioSystemManagerForApplet final : public ServiceFramework<IAudioSystemManagerForApplet> {
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);
}
};
class IAudioSystemManagerForDebugger final : public ServiceFramework<IAudioSystemManagerForDebugger> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("aud:a", std::make_shared<IAudioSystemManagerForApplet>(system));
server_manager->RegisterNamedService("aud:d", std::make_shared<IAudioSystemManagerForDebugger>(system));
server_manager->RegisterNamedService("audout:d", std::make_shared<IAudioOutManagerForDebugger>(system));
server_manager->RegisterNamedService("audin:d", std::make_shared<IAudioInManagerForDebugger>(system));
server_manager->RegisterNamedService("audrec:d", std::make_shared<IFinalOutputRecorderManagerForDebugger>(system));
server_manager->RegisterNamedService("audren:d", std::make_shared<IAudioInManager>(system));
server_manager->RegisterNamedService("audin:u", std::make_shared<IAudioInManager>(system));
server_manager->RegisterNamedService("audin:a", std::make_shared<IAudioInManagerForApplet>(system));
server_manager->RegisterNamedService("audout:u", std::make_shared<IAudioOutManager>(system));
server_manager->RegisterNamedService("audout:a", std::make_shared<IAudioOutManagerForApplet>(system));
server_manager->RegisterNamedService("auddev", std::make_shared<IAudioSnoopManager>(system));
// Depends on audout:u and audin:u on ctor!
server_manager->RegisterNamedService("audctl", std::make_shared<IAudioController>(system));
server_manager->RegisterNamedService("audrec:a", std::make_shared<IFinalOutputRecorderManagerForApplet>(system));
server_manager->RegisterNamedService("audrec:u", std::make_shared<IFinalOutputRecorderManager>(system));
server_manager->RegisterNamedService("audren:u", std::make_shared<IAudioRendererManager>(system));
server_manager->RegisterNamedService("audren:a", std::make_shared<IAudioRendererManagerForApplet>(system));
server_manager->RegisterNamedService("hwopus", std::make_shared<IHardwareOpusDecoderManager>(system));
ServerManager::RunServer(std::move(server_manager));
}
@@ -11,6 +11,7 @@
#include "core/hle/service/audio/audio_device.h"
#include "core/hle/service/audio/audio_renderer.h"
#include "core/hle/service/audio/audio_renderer_manager.h"
#include "core/hle/service/audio/errors.h"
#include "core/hle/service/cmif_serialization.h"
namespace Service::Audio {
@@ -54,6 +55,11 @@ Result IAudioRendererManager::OpenAudioRenderer(
R_THROW(Audio::ResultOutOfSessions);
}
if (!process_handle) {
LOG_ERROR(Service_Audio, "Invalid handles");
R_THROW(Audio::ResultInvalidHandle);
}
LOG_DEBUG(Service_Audio, "Opened new AudioRenderer session {} sessions open {}", session_id,
impl->GetSessionCount());
+50
View File
@@ -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
@@ -54,11 +57,58 @@ public:
}
};
class BPC_C final : public ServiceFramework<BPC_C> {
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);
}
};
class BPC_B final : public ServiceFramework<BPC_B> {
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);
}
};
class BPC_W final : public ServiceFramework<BPC_W> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("bpc", std::make_shared<BPC>(system));
server_manager->RegisterNamedService("bpc:r", std::make_shared<BPC_R>(system));
server_manager->RegisterNamedService("bpc:c", std::make_shared<BPC_C>(system));
server_manager->RegisterNamedService("bpc:b", std::make_shared<BPC_B>(system));
server_manager->RegisterNamedService("bpc:w", std::make_shared<BPC_W>(system));
ServerManager::RunServer(std::move(server_manager));
}
+28 -14
View File
@@ -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,27 +14,38 @@
#include "core/hle/service/caps/caps_u.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#include "frontend_common/firmware_manager.h"
namespace Service::Capture {
class IDecoderControlService final : public ServiceFramework<IDecoderControlService> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto album_manager = std::make_shared<AlbumManager>(system);
server_manager->RegisterNamedService(
"caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
server_manager->RegisterNamedService(
"caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
server_manager->RegisterNamedService(
"caps:u", std::make_shared<IAlbumApplicationService>(system, album_manager));
server_manager->RegisterNamedService(
"caps:ss", std::make_shared<IScreenShotService>(system, album_manager));
server_manager->RegisterNamedService("caps:sc",
std::make_shared<IScreenShotControlService>(system));
server_manager->RegisterNamedService(
"caps:su", std::make_shared<IScreenShotApplicationService>(system, album_manager));
server_manager->RegisterNamedService("caps:a", std::make_shared<IAlbumAccessorService>(system, album_manager));
server_manager->RegisterNamedService("caps:c", std::make_shared<IAlbumControlService>(system, album_manager));
server_manager->RegisterNamedService("caps:u", std::make_shared<IAlbumApplicationService>(system, album_manager));
server_manager->RegisterNamedService("caps:ss", std::make_shared<IScreenShotService>(system, album_manager));
server_manager->RegisterNamedService("caps:sc", std::make_shared<IScreenShotControlService>(system));
server_manager->RegisterNamedService("caps:su", std::make_shared<IScreenShotApplicationService>(system, album_manager));
// +4.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 4) {
server_manager->RegisterNamedService("caps:dc", std::make_shared<IDecoderControlService>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+6 -12
View File
@@ -243,13 +243,10 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
return SaveScreenShot(out_entry, attribute, report_option, {}, image_data, aruid);
}
Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
const ScreenShotAttribute& attribute,
AlbumReportOption report_option,
const ApplicationData& app_data, std::span<const u8> image_data,
u64 aruid) {
const u64 title_id = system.GetApplicationProcessProgramID();
Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry, const ScreenShotAttribute& attribute, AlbumReportOption report_option, const ApplicationData& app_data, std::span<const u8> image_data, u64 aruid) {
R_UNLESS(!image_data.empty(), ResultUnknown); //TODO: ???
const u64 title_id = system.GetApplicationProcessProgramID();
auto static_service =
system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true);
@@ -264,14 +261,12 @@ Result AlbumManager::SaveScreenShot(ApplicationAlbumEntry& out_entry,
}
const auto date = ConvertToAlbumDateTime(posix_time);
return SaveImage(out_entry, image_data, title_id, date);
}
Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry,
const ScreenShotAttribute& attribute,
const AlbumFileId& file_id,
std::span<const u8> image_data) {
Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry, const ScreenShotAttribute& attribute, const AlbumFileId& file_id, std::span<const u8> image_data) {
R_UNLESS(!image_data.empty(), ResultUnknown); //TODO: ???
auto static_service =
system.ServiceManager().GetService<Service::Glue::Time::StaticService>("time:u", true);
@@ -286,7 +281,6 @@ Result AlbumManager::SaveEditedScreenShot(ApplicationAlbumEntry& out_entry,
}
const auto date = ConvertToAlbumDateTime(posix_time);
return SaveImage(out_entry, image_data, file_id.application_id, date);
}
+90 -1
View File
@@ -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
@@ -9,6 +9,7 @@
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#include "frontend_common/firmware_manager.h"
namespace Service::ES {
@@ -319,10 +320,98 @@ private:
Core::Crypto::KeyManager& keys = Core::Crypto::KeyManager::Instance();
};
class NDRM_LU final : public ServiceFramework<NDRM_LU> {
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);
}
};
class NDRM_LA final : public ServiceFramework<NDRM_LA> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("es", std::make_shared<ETicket>(system));
// +13.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 13) {
server_manager->RegisterNamedService("ndrm:lu", std::make_shared<NDRM_LU>(system));
server_manager->RegisterNamedService("ndrm:la", std::make_shared<NDRM_LA>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+69 -10
View File
@@ -497,20 +497,79 @@ Module::Interface::Interface(std::shared_ptr<Module> module_, Core::System& syst
Module::Interface::~Interface() = default;
class IServiceForApplication final : public ServiceFramework<IServiceForApplication> {
public:
explicit IServiceForApplication(Core::System& system_)
: ServiceFramework{system_, "nd:app"}
{
static const FunctionInfo functions[] = {
{0, nullptr, "GetReceivableNeighborInfoCountMax"},
{10, nullptr, "IsNeighborDetectionEnabled"},
};
RegisterHandlers(functions);
}
};
class IServiceForSystem final : public ServiceFramework<IServiceForSystem> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto module = std::make_shared<Module>();
server_manager->RegisterNamedService("friend:a",
std::make_shared<Friend>(module, system, "friend:a"));
server_manager->RegisterNamedService("friend:m",
std::make_shared<Friend>(module, system, "friend:m"));
server_manager->RegisterNamedService("friend:s",
std::make_shared<Friend>(module, system, "friend:s"));
server_manager->RegisterNamedService("friend:u",
std::make_shared<Friend>(module, system, "friend:u"));
server_manager->RegisterNamedService("friend:v",
std::make_shared<Friend>(module, system, "friend:v"));
server_manager->RegisterNamedService("nd:app", std::make_shared<IServiceForApplication>(system));
server_manager->RegisterNamedService("nd:sys", std::make_shared<IServiceForSystem>(system));
server_manager->RegisterNamedService("friend:a", std::make_shared<Friend>(module, system, "friend:a"));
server_manager->RegisterNamedService("friend:m", std::make_shared<Friend>(module, system, "friend:m"));
server_manager->RegisterNamedService("friend:s", std::make_shared<Friend>(module, system, "friend:s"));
server_manager->RegisterNamedService("friend:u", std::make_shared<Friend>(module, system, "friend:u"));
server_manager->RegisterNamedService("friend:v", std::make_shared<Friend>(module, system, "friend:v"));
ServerManager::RunServer(std::move(server_manager));
}
+24
View File
@@ -43,6 +43,30 @@ private:
}
};
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[] = {
+15
View File
@@ -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
@@ -11,6 +14,18 @@ class System;
namespace Service::Glue {
class ECTX_W final : public ServiceFramework<ECTX_W> {
public:
explicit ECTX_W(Core::System& system_);
~ECTX_W() override;
};
class ECTX_R final : public ServiceFramework<ECTX_R> {
public:
explicit ECTX_R(Core::System& system_);
~ECTX_R() override;
};
class ECTX_AW final : public ServiceFramework<ECTX_AW> {
public:
explicit ECTX_AW(Core::System& system_);
+12 -22
View File
@@ -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
@@ -19,40 +22,27 @@ void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
// ARP
server_manager->RegisterNamedService("arp:r",
std::make_shared<ARP_R>(system, system.GetARPManager()));
server_manager->RegisterNamedService("arp:w",
std::make_shared<ARP_W>(system, system.GetARPManager()));
server_manager->RegisterNamedService("arp:r", std::make_shared<ARP_R>(system, system.GetARPManager()));
server_manager->RegisterNamedService("arp:w", std::make_shared<ARP_W>(system, system.GetARPManager()));
// BackGround Task Controller
server_manager->RegisterNamedService("bgtc:t", std::make_shared<BGTC_T>(system));
server_manager->RegisterNamedService("bgtc:sc", std::make_shared<BGTC_SC>(system));
// Error Context
server_manager->RegisterNamedService("ectx:w", std::make_shared<ECTX_W>(system));
server_manager->RegisterNamedService("ectx:r", std::make_shared<ECTX_R>(system));
server_manager->RegisterNamedService("ectx:aw", std::make_shared<ECTX_AW>(system));
// Notification Services
server_manager->RegisterNamedService(
"notif:a", std::make_shared<INotificationServicesForApplication>(system));
server_manager->RegisterNamedService("notif:s",
std::make_shared<INotificationServices>(system));
server_manager->RegisterNamedService("notif:a", std::make_shared<INotificationServicesForApplication>(system));
server_manager->RegisterNamedService("notif:s", std::make_shared<INotificationServices>(system));
// Time
auto time = std::make_shared<Time::TimeManager>(system);
server_manager->RegisterNamedService(
"time:u",
std::make_shared<Time::StaticService>(
system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 0}, time, "time:u"));
server_manager->RegisterNamedService(
"time:a",
std::make_shared<Time::StaticService>(
system, Service::PSC::Time::StaticServiceSetupInfo{1, 1, 0, 1, 0, 0}, time, "time:a"));
server_manager->RegisterNamedService(
"time:r",
std::make_shared<Time::StaticService>(
system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 1, 0}, time, "time:r"));
server_manager->RegisterNamedService("time:u", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 0}, time, "time:u"));
server_manager->RegisterNamedService("time:a", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{1, 1, 0, 1, 0, 0}, time, "time:a"));
server_manager->RegisterNamedService("time:r", std::make_shared<Time::StaticService>(system, Service::PSC::Time::StaticServiceSetupInfo{0, 0, 0, 0, 1, 0}, time, "time:r"));
ServerManager::RunServer(std::move(server_manager));
}
+4 -6
View File
@@ -116,12 +116,10 @@ Result NotificationServiceImpl::Initialize(u64 aruid) {
R_SUCCEED();
}
std::vector<AlarmSetting>::iterator NotificationServiceImpl::GetAlarmFromId(
AlarmSettingId alarm_setting_id) {
return std::find_if(alarms.begin(), alarms.end(),
[alarm_setting_id](const AlarmSetting& alarm) {
return alarm.alarm_setting_id == alarm_setting_id;
});
std::vector<AlarmSetting>::iterator NotificationServiceImpl::GetAlarmFromId(AlarmSettingId alarm_setting_id) {
return std::find_if(alarms.begin(), alarms.end(), [alarm_setting_id](const AlarmSetting& alarm) {
return alarm.alarm_setting_id == alarm_setting_id;
});
}
INotificationServicesForApplication::INotificationServicesForApplication(Core::System& system_)
+18
View File
@@ -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,10 +29,25 @@ public:
}
};
class GRC_D final : public ServiceFramework<GRC_D> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("grc:c", std::make_shared<GRC>(system));
server_manager->RegisterNamedService("grc:d", std::make_shared<GRC_D>(system));
ServerManager::RunServer(std::move(server_manager));
}
+63 -10
View File
@@ -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,27 +19,77 @@
namespace Service::HID {
class IHidTemporaryServer final : public ServiceFramework<IHidTemporaryServer> {
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);
}
~IHidTemporaryServer() override = default;
};
class AHID_CD final : public ServiceFramework<AHID_CD> {
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);
}
~AHID_CD() override = default;
};
class AHID_HDR final : public ServiceFramework<AHID_HDR> {
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);
}
~AHID_HDR() override = default;
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
std::shared_ptr<HidFirmwareSettings> firmware_settings =
std::make_shared<HidFirmwareSettings>(system);
std::shared_ptr<ResourceManager> resource_manager =
std::make_shared<ResourceManager>(system, firmware_settings);
auto firmware_settings = std::make_shared<HidFirmwareSettings>(system);
auto resource_manager = std::make_shared<ResourceManager>(system, firmware_settings);
resource_manager->Initialize();
server_manager->RegisterNamedService(
"hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService(
"hid:dbg", std::make_shared<IHidDebugServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService(
"hid:sys", std::make_shared<IHidSystemServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService("hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService("hid:dbg", std::make_shared<IHidDebugServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService("hid:sys", std::make_shared<IHidSystemServer>(system, resource_manager, firmware_settings));
server_manager->RegisterNamedService("hid:tmp", std::make_shared<IHidTemporaryServer>(system));
server_manager->RegisterNamedService("hidbus", std::make_shared<Hidbus>(system));
server_manager->RegisterNamedService("irs", std::make_shared<IRS::IRS>(system));
server_manager->RegisterNamedService("irs:sys", std::make_shared<IRS::IRS_SYS>(system));
server_manager->RegisterNamedService("ahid:cd", std::make_shared<AHID_CD>(system));
server_manager->RegisterNamedService("ahid:hdr", std::make_shared<AHID_HDR>(system));
server_manager->RegisterNamedService("xcd:sys", std::make_shared<XCD_SYS>(system));
system.RunServer(std::move(server_manager));
+22 -2
View File
@@ -38,10 +38,30 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
{213, nullptr, "ActivateNfc"},
{214, nullptr, "GetXcdHandleForNpadWithNfc"},
{215, nullptr, "IsNfcActivated"},
{230, nullptr, "AcquireIrSensorEventHandle"},
{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, "GetXcdHandleForNpadWithIrSensor"},
{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"},
+4 -4
View File
@@ -330,12 +330,12 @@ public:
/// Helper function to test whether the output buffer at buffer_index can be written
[[nodiscard]] bool CanWriteBuffer(std::size_t buffer_index = 0) const;
[[nodiscard]] Handle GetCopyHandle(std::size_t index) const {
return incoming_copy_handles.at(index);
[[nodiscard]] Handle GetCopyHandle(std::size_t index) const noexcept {
return index >= incoming_copy_handles.size() ? 0 : incoming_copy_handles[index];
}
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const {
return incoming_move_handles.at(index);
[[nodiscard]] Handle GetMoveHandle(std::size_t index) const noexcept {
return index >= incoming_move_handles.size() ? 0 : incoming_move_handles[index];
}
void AddMoveObject(Kernel::KAutoObject* object) {
+16
View File
@@ -357,10 +357,26 @@ private:
}
};
class LM_GET final : public ServiceFramework<LM_GET> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("lm", std::make_shared<LM>(system));
server_manager->RegisterNamedService("lm:get", std::make_shared<LM_GET>(system));
ServerManager::RunServer(std::move(server_manager));
}
+2 -4
View File
@@ -367,10 +367,8 @@ void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
std::shared_ptr<MiiManager> manager = std::make_shared<MiiManager>();
server_manager->RegisterNamedService(
"mii:e", std::make_shared<IStaticService>(system, "mii:e", manager, true));
server_manager->RegisterNamedService(
"mii:u", std::make_shared<IStaticService>(system, "mii:u", manager, false));
server_manager->RegisterNamedService("mii:e", std::make_shared<IStaticService>(system, "mii:e", manager, true));
server_manager->RegisterNamedService("mii:u", std::make_shared<IStaticService>(system, "mii:u", manager, false));
server_manager->RegisterNamedService("miiimg", std::make_shared<IImageDatabaseService>(system));
ServerManager::RunServer(std::move(server_manager));
}
+86
View File
@@ -0,0 +1,86 @@
// 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
#include "common/logging.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/mnpp/mnpp.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
namespace Service::MNPP {
class MNPP_APP final : public ServiceFramework<MNPP_APP> {
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
RegisterHandlers(functions);
}
private:
void Cmd0(HLERequestContext& ctx) {
LOG_WARNING(Service_MNPP, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Cmd1(HLERequestContext& ctx) {
LOG_WARNING(Service_MNPP, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
};
class MNPP_SYS final : public ServiceFramework<MNPP_SYS> {
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);
}
};
class MNPP_WEB final : public ServiceFramework<MNPP_WEB> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("mnpp:app", std::make_shared<MNPP_APP>(system));
server_manager->RegisterNamedService("mnpp:sys", std::make_shared<MNPP_SYS>(system));
server_manager->RegisterNamedService("mnpp:web", std::make_shared<MNPP_WEB>(system));
ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::MNPP
@@ -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
-51
View File
@@ -1,51 +0,0 @@
// 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
#include "common/logging.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/mnpp/mnpp_app.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
namespace Service::MNPP {
class MNPP_APP final : public ServiceFramework<MNPP_APP> {
public:
explicit MNPP_APP(Core::System& system_) : ServiceFramework{system_, "mnpp:app"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &MNPP_APP::Unknown0, "unknown0"},
{1, &MNPP_APP::Unknown1, "unknown1"},
};
// clang-format on
RegisterHandlers(functions);
}
private:
void Unknown0(HLERequestContext& ctx) {
LOG_WARNING(Service_MNPP, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void Unknown1(HLERequestContext& ctx) {
LOG_WARNING(Service_MNPP, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("mnpp:app", std::make_shared<MNPP_APP>(system));
ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::MNPP
+15
View File
@@ -427,11 +427,26 @@ private:
}
};
class NCM_V final : public ServiceFramework<NCM_V> {
public:
explicit NCM_V(Core::System& system_)
: ServiceFramework{system_, "ncm:v"}
{
static const FunctionInfo functions[] = {
{0, nullptr, "GetSystemVersion"},
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("lr", std::make_shared<LR>(system));
server_manager->RegisterNamedService("ncm", std::make_shared<NCM>(system));
if (1 /* not retail */) {
server_manager->RegisterNamedService("ncm:v", std::make_shared<NCM_V>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+33 -10
View File
@@ -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
@@ -13,13 +13,13 @@
namespace Service::NGC {
class NgctServiceImpl final : public ServiceFramework<NgctServiceImpl> {
class IService final : public ServiceFramework<IService> {
public:
explicit NgctServiceImpl(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {
explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &NgctServiceImpl::Match, "Match"},
{1, &NgctServiceImpl::Filter, "Filter"},
{0, &IService::Match, "Match"},
{1, &IService::Filter, "Filter"},
};
// clang-format on
@@ -29,8 +29,9 @@ public:
private:
void Match(HLERequestContext& ctx) {
const auto buffer = ctx.ReadBuffer();
const auto text = Common::StringFromFixedZeroTerminatedBuffer(
reinterpret_cast<const char*>(buffer.data()), buffer.size());
const auto text = !buffer.empty()
? Common::StringFromFixedZeroTerminatedBuffer(reinterpret_cast<const char*>(buffer.data()), buffer.size())
: std::string{};
LOG_WARNING(Service_NGC, "(STUBBED) called, text={}", text);
@@ -42,8 +43,9 @@ private:
void Filter(HLERequestContext& ctx) {
const auto buffer = ctx.ReadBuffer();
const auto text = Common::StringFromFixedZeroTerminatedBuffer(
reinterpret_cast<const char*>(buffer.data()), buffer.size());
const auto text = !buffer.empty()
? Common::StringFromFixedZeroTerminatedBuffer(reinterpret_cast<const char*>(buffer.data()), buffer.size())
: std::string{};
LOG_WARNING(Service_NGC, "(STUBBED) called, text={}", text);
@@ -144,10 +146,31 @@ private:
}
};
class IServiceWithManagementApi final : public ServiceFramework<IServiceWithManagementApi> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("ngct:u", std::make_shared<NgctServiceImpl>(system));
server_manager->RegisterNamedService("ngct:u", std::make_shared<IService>(system));
server_manager->RegisterNamedService("ngct:s", std::make_shared<IServiceWithManagementApi>(system));
server_manager->RegisterNamedService("ngc:u", std::make_shared<NgcServiceImpl>(system));
ServerManager::RunServer(std::move(server_manager));
}
+14
View File
@@ -519,11 +519,25 @@ private:
}
};
class NIM_ECAS final : public ServiceFramework<NIM_ECAS> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("nim", std::make_shared<NIM>(system));
server_manager->RegisterNamedService("nim:eca", std::make_shared<NIM_ECA>(system));
server_manager->RegisterNamedService("nim:ecas", std::make_shared<NIM_ECAS>(system));
server_manager->RegisterNamedService("nim:shp", std::make_shared<NIM_SHP>(system));
server_manager->RegisterNamedService("ntc", std::make_shared<NTC>(system));
ServerManager::RunServer(std::move(server_manager));
+37 -18
View File
@@ -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,32 +15,48 @@
namespace Service::NS {
class INotifyService final : public ServiceFramework<INotifyService> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService(
"ns:am2", std::make_shared<IServiceGetterInterface>(system, "ns:am2"));
server_manager->RegisterNamedService(
"ns:ec", std::make_shared<IServiceGetterInterface>(system, "ns:ec"));
server_manager->RegisterNamedService(
"ns:rid", std::make_shared<IServiceGetterInterface>(system, "ns:rid"));
server_manager->RegisterNamedService(
"ns:rt", std::make_shared<IServiceGetterInterface>(system, "ns:rt"));
server_manager->RegisterNamedService(
"ns:web", std::make_shared<IServiceGetterInterface>(system, "ns:web"));
server_manager->RegisterNamedService(
"ns:ro", std::make_shared<IServiceGetterInterface>(system, "ns:ro"));
server_manager->RegisterNamedService("ns:am2", std::make_shared<IServiceGetterInterface>(system, "ns:am2"));
server_manager->RegisterNamedService("ns:ec", std::make_shared<IServiceGetterInterface>(system, "ns:ec"));
server_manager->RegisterNamedService("ns:rid", std::make_shared<IServiceGetterInterface>(system, "ns:rid"));
server_manager->RegisterNamedService("ns:rt", std::make_shared<IServiceGetterInterface>(system, "ns:rt"));
server_manager->RegisterNamedService("ns:web", std::make_shared<IServiceGetterInterface>(system, "ns:web"));
server_manager->RegisterNamedService("ns:ro", std::make_shared<IServiceGetterInterface>(system, "ns:ro"));
server_manager->RegisterNamedService("ns:dev", std::make_shared<IDevelopInterface>(system));
server_manager->RegisterNamedService("ns:su", std::make_shared<ISystemUpdateInterface>(system));
server_manager->RegisterNamedService("ns:vm",
std::make_shared<IVulnerabilityManagerInterface>(system));
server_manager->RegisterNamedService("ns:vm", std::make_shared<IVulnerabilityManagerInterface>(system));
server_manager->RegisterNamedService("pdm:ntfy", std::make_shared<INotifyService>(system));
server_manager->RegisterNamedService("pdm:qry", std::make_shared<IQueryService>(system));
server_manager->RegisterNamedService("pl:s",
std::make_shared<IPlatformServiceManager>(system, "pl:s"));
server_manager->RegisterNamedService("pl:u",
std::make_shared<IPlatformServiceManager>(system, "pl:u"));
server_manager->RegisterNamedService("pl:s", std::make_shared<IPlatformServiceManager>(system, "pl:s"));
server_manager->RegisterNamedService("pl:u", std::make_shared<IPlatformServiceManager>(system, "pl:u"));
ServerManager::RunServer(std::move(server_manager));
}
@@ -38,6 +38,12 @@ IQueryService::IQueryService(Core::System& system_) : ServiceFramework{system_,
{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
+69 -16
View File
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
// SPDX-FileCopyrightText: 2021 Skyline Team and Contributors
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -25,6 +28,7 @@
#include "core/hle/service/nvdrv/nvmemp.h"
#include "core/hle/service/nvnflinger/nvnflinger.h"
#include "core/hle/service/server_manager.h"
#include "frontend_common/firmware_manager.h"
#include "video_core/gpu.h"
namespace Service::Nvidia {
@@ -42,26 +46,75 @@ void EventInterface::FreeEvent(Kernel::KEvent* event) {
module.service_context.CloseEvent(event);
}
class NVGEM_C final : public ServiceFramework<NVGEM_C> {
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);
}
};
class NVGEM_CD final : public ServiceFramework<NVGEM_CD> {
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);
}
};
class NVDBG_D final : public ServiceFramework<NVDBG_D> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto module = std::make_shared<Module>(system);
const auto NvdrvInterfaceFactoryForApplication = [&, module] {
return std::make_shared<NVDRV>(system, module, "nvdrv");
};
const auto NvdrvInterfaceFactoryForApplets = [&, module] {
return std::make_shared<NVDRV>(system, module, "nvdrv:a");
};
const auto NvdrvInterfaceFactoryForSysmodules = [&, module] {
return std::make_shared<NVDRV>(system, module, "nvdrv:s");
};
const auto NvdrvInterfaceFactoryForTesting = [&, module] {
return std::make_shared<NVDRV>(system, module, "nvdrv:t");
};
server_manager->RegisterNamedService("nvdrv", NvdrvInterfaceFactoryForApplication);
server_manager->RegisterNamedService("nvdrv:a", NvdrvInterfaceFactoryForApplets);
server_manager->RegisterNamedService("nvdrv:s", NvdrvInterfaceFactoryForSysmodules);
server_manager->RegisterNamedService("nvdrv:t", NvdrvInterfaceFactoryForTesting);
server_manager->RegisterNamedService("nvdrv", std::make_shared<NVDRV>(system, module, "nvdrv"));
server_manager->RegisterNamedService("nvdrv:a", std::make_shared<NVDRV>(system, module, "nvdrv:a"));
server_manager->RegisterNamedService("nvdrv:s", std::make_shared<NVDRV>(system, module, "nvdrv:s"));
server_manager->RegisterNamedService("nvdrv:t", std::make_shared<NVDRV>(system, module, "nvdrv:t"));
server_manager->RegisterNamedService("nvmemp", std::make_shared<NVMEMP>(system));
server_manager->RegisterNamedService("nvgem:c", std::make_shared<NVGEM_C>(system));
server_manager->RegisterNamedService("nvgem:cd", std::make_shared<NVGEM_CD>(system));
// +10.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 10) {
server_manager->RegisterNamedService("nvdbg:d", std::make_shared<NVDBG_D>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+18 -12
View File
@@ -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
@@ -9,20 +12,23 @@
namespace Service::OLSC {
class ISProfileBgAgentForSystemProcess final : public ServiceFramework<ISProfileBgAgentForSystemProcess> {
public:
explicit ISProfileBgAgentForSystemProcess(Core::System& system_)
: ServiceFramework{system_, "spbg:sp"}
{
static const FunctionInfo functions[] = {
{ 100, nullptr, "OpenBgAgentController" },
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
const auto OlscFactoryForApplication = [&] {
return std::make_shared<IOlscServiceForApplication>(system);
};
const auto OlscFactoryForSystemService = [&] {
return std::make_shared<IOlscServiceForSystemService>(system);
};
server_manager->RegisterNamedService("olsc:u", OlscFactoryForApplication);
server_manager->RegisterNamedService("olsc:s", OlscFactoryForSystemService);
server_manager->RegisterNamedService("olsc:u", std::make_shared<IOlscServiceForApplication>(system));
server_manager->RegisterNamedService("olsc:s", std::make_shared<IOlscServiceForSystemService>(system));
server_manager->RegisterNamedService("spbg:sp", std::make_shared<ISProfileBgAgentForSystemProcess>(system));
ServerManager::RunServer(std::move(server_manager));
}
+22 -4
View File
@@ -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
@@ -9,6 +9,7 @@
#include "core/hle/service/pcie/pcie.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#include "frontend_common/firmware_manager.h"
namespace Service::PCIe {
@@ -48,9 +49,9 @@ public:
}
};
class PCIe final : public ServiceFramework<PCIe> {
class PCIE final : public ServiceFramework<PCIE> {
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"},
@@ -62,10 +63,27 @@ public:
}
};
class PCIE_LOG final : public ServiceFramework<PCIE_LOG> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("pcie", std::make_shared<PCIe>(system));
server_manager->RegisterNamedService("pcie", std::make_shared<PCIE>(system));
// +6.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 6) {
server_manager->RegisterNamedService("pcie:log", std::make_shared<PCIE_LOG>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+26
View File
@@ -55,6 +55,30 @@ public:
}
};
class PCV_ARB final : public ServiceFramework<PCV_ARB> {
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);
}
};
class PCV_IMM final : public ServiceFramework<PCV_IMM> {
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);
}
};
class IClkrstSession final : public ServiceFramework<IClkrstSession> {
public:
explicit IClkrstSession(Core::System& system_, DeviceCode device_code_)
@@ -148,6 +172,8 @@ void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("pcv", std::make_shared<PCV>(system));
server_manager->RegisterNamedService("pcv:arb", std::make_shared<PCV_ARB>(system));
server_manager->RegisterNamedService("pcv:imm", std::make_shared<PCV_IMM>(system));
server_manager->RegisterNamedService("clkrst", std::make_shared<CLKRST>(system, "clkrst"));
server_manager->RegisterNamedService("clkrst:i", std::make_shared<CLKRST>(system, "clkrst:i"));
server_manager->RegisterNamedService("clkrst:a", std::make_shared<CLKRST_A>(system));
+96 -7
View File
@@ -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
@@ -14,23 +17,109 @@
namespace Service::PSC {
class PSC_L final : public ServiceFramework<PSC_L> {
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);
}
};
class INS_R final : public ServiceFramework<INS_R> {
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);
}
};
class INS_S final : public ServiceFramework<INS_S> {
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);
}
};
class HSHL_SYS final : public ServiceFramework<HSHL_SYS> {
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);
}
};
class HSHL_SET final : public ServiceFramework<HSHL_SET> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("psc:c", std::make_shared<IPmControl>(system));
server_manager->RegisterNamedService("psc:m", std::make_shared<IPmService>(system));
server_manager->RegisterNamedService("psc:l", std::make_shared<PSC_L>(system));
server_manager->RegisterNamedService("ins:r", std::make_shared<INS_R>(system));
server_manager->RegisterNamedService("ins:s", std::make_shared<INS_S>(system));
server_manager->RegisterNamedService("hshl:sys", std::make_shared<HSHL_SYS>(system));
server_manager->RegisterNamedService("hshl:set", std::make_shared<HSHL_SET>(system));
server_manager->RegisterNamedService("ovln:rcv", std::make_shared<IReceiverService>(system));
server_manager->RegisterNamedService("ovln:snd", std::make_shared<ISenderService>(system));
auto time = std::make_shared<Time::TimeManager>(system);
server_manager->RegisterNamedService(
"time:m", std::make_shared<Time::ServiceManager>(system, time, server_manager.get()));
server_manager->RegisterNamedService(
"time:su", std::make_shared<Time::StaticService>(
system, Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 1}, time, "time:su"));
server_manager->RegisterNamedService("time:al",
std::make_shared<Time::IAlarmService>(system, time));
server_manager->RegisterNamedService("time:m", std::make_shared<Time::ServiceManager>(system, time, server_manager.get()));
server_manager->RegisterNamedService("time:su", std::make_shared<Time::StaticService>(system, Time::StaticServiceSetupInfo{0, 0, 0, 0, 0, 1}, time, "time:su"));
server_manager->RegisterNamedService("time:al", std::make_shared<Time::IAlarmService>(system, time));
ServerManager::RunServer(std::move(server_manager));
}
@@ -159,6 +159,8 @@ Result ServiceManager::SetupTimeZoneServiceCore(const LocationName& name,
name, rule_version, location_count, time_point,
time_point.clock_source_id.RawString());
R_UNLESS(!rule_buffer.empty(), ResultUnknown); //TODO: ???
if (m_time_zone.ParseBinary(name, rule_buffer) != ResultSuccess) {
LOG_ERROR(Service_Time, "Failed to parse time zone binary!");
}
+35
View File
@@ -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
@@ -11,10 +14,42 @@
namespace Service::PTM {
class PSM_MANU final : public ServiceFramework<PSM_MANU> {
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);
}
};
class POWCTL final : public ServiceFramework<POWCTL> {
public:
explicit POWCTL(Core::System& system_)
: ServiceFramework{system_, "powctl"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "OpenSession"},
};
// clang-format on
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("psm", std::make_shared<PSM>(system));
if (1 /* not retail */) {
server_manager->RegisterNamedService("psm:manu", std::make_shared<PSM_MANU>(system));
server_manager->RegisterNamedService("powctl", std::make_shared<POWCTL>(system));
}
server_manager->RegisterNamedService("ts", std::make_shared<TS>(system));
ServerManager::RunServer(std::move(server_manager));
}
+16 -12
View File
@@ -571,22 +571,26 @@ private:
} // namespace
class IDebugMonitorInterface final : public ServiceFramework<IDebugMonitorInterface> {
public:
explicit IDebugMonitorInterface(Core::System& system_)
: ServiceFramework{system_, "ro:dmnt"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "GetProcessModuleInfo" },
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto ro = std::make_shared<RoContext>();
const auto RoInterfaceFactoryForUser = [&, ro] {
return std::make_shared<RoInterface>(system, "ldr:ro", ro, NrrKind::User);
};
const auto RoInterfaceFactoryForJitPlugin = [&, ro] {
return std::make_shared<RoInterface>(system, "ro:1", ro, NrrKind::JitPlugin);
};
server_manager->RegisterNamedService("ldr:ro", std::move(RoInterfaceFactoryForUser));
server_manager->RegisterNamedService("ro:1", std::move(RoInterfaceFactoryForJitPlugin));
server_manager->RegisterNamedService("ldr:ro", std::make_shared<RoInterface>(system, "ldr:ro", ro, NrrKind::User));
server_manager->RegisterNamedService("ro:1", std::make_shared<RoInterface>(system, "ro:1", ro, NrrKind::JitPlugin));
server_manager->RegisterNamedService("ro:dmnt", std::make_shared<IDebugMonitorInterface>(system));
ServerManager::RunServer(std::move(server_manager));
}
+5 -1
View File
@@ -37,7 +37,7 @@
#include "core/hle/service/mig/mig.h"
#include "core/hle/service/mii/mii.h"
#include "core/hle/service/mm/mm_u.h"
#include "core/hle/service/mnpp/mnpp_app.h"
#include "core/hle/service/mnpp/mnpp.h"
#include "core/hle/service/ncm/ncm.h"
#include "core/hle/service/nfc/nfc.h"
#include "core/hle/service/nfp/nfp.h"
@@ -64,6 +64,8 @@
#include "core/hle/service/sockets/sockets.h"
#include "core/hle/service/spl/spl_module.h"
#include "core/hle/service/ssl/ssl.h"
#include "core/hle/service/wlan/wlan.h"
#include "core/hle/service/tma/tma.h"
#include "core/hle/service/usb/usb.h"
#include "core/hle/service/vi/vi.h"
@@ -146,6 +148,8 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system
{"ro", &RO::LoopProcess},
{"spl", &SPL::LoopProcess},
{"ssl", &SSL::LoopProcess},
{"wlan", &WLAN::LoopProcess},
{"tma", &TMA::LoopProcess},
{"usb", &USB::LoopProcess},
{"i2c", &I2C::LoopProcess},
{"gpio", &GPIO::LoopProcess},
+53 -11
View File
@@ -173,8 +173,26 @@ void BSD::Socket(HLERequestContext& ctx) {
LOG_DEBUG(Service, "called. domain={} type={} protocol={}", domain, type, protocol);
const auto [fd, bsd_errno] = SocketImpl(static_cast<Domain>(domain), static_cast<Type>(type),
static_cast<Protocol>(protocol));
const auto [fd, bsd_errno] = SocketImpl(Domain(domain), Type(type), Protocol(protocol));
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
rb.Push<s32>(fd);
rb.PushEnum(bsd_errno);
}
void BSD::SocketExempt(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const u32 domain = rp.Pop<u32>();
const u32 type = rp.Pop<u32>();
const u32 protocol = rp.Pop<u32>();
LOG_DEBUG(Service, "called. domain={} type={} protocol={}", domain, type, protocol);
auto [fd, bsd_errno] = SocketImpl(Domain(domain), Type(type), Protocol(protocol));
if (bsd_errno == Errno::SUCCESS) {
bsd_errno = ShutdownImpl(fd, 0);
}
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
@@ -445,6 +463,7 @@ void BSD::Close(HLERequestContext& ctx) {
BuildErrnoResponse(ctx, CloseImpl(fd));
}
/// @brief Only bsd:s is able to dup()
void BSD::DuplicateSocket(HLERequestContext& ctx) {
struct InputParameters {
s32 fd;
@@ -463,6 +482,13 @@ void BSD::DuplicateSocket(HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
if (is_user) {
rb.PushRaw(OutputParameters{
.ret = 0,
.bsd_errno = Errno::INVAL,
});
return;
}
auto const res_v = DuplicateSocketImpl(input.fd);
if (auto* res = std::get_if<s32>(&res_v)) {
@@ -496,11 +522,13 @@ void BSD::ExecuteWork(HLERequestContext& ctx, Work work) {
}
std::pair<s32, Errno> BSD::SocketImpl(Domain domain, Type type, Protocol protocol) {
if (type == Type::SEQPACKET) {
UNIMPLEMENTED_MSG("SOCK_SEQPACKET errno management");
} else if (type == Type::RAW && (domain != Domain::INET || protocol != Protocol::ICMP)) {
UNIMPLEMENTED_MSG("SOCK_RAW errno management");
// user bsd:u has restrictions on SOCK_SEQPACKET and SOCK_RAW
if (is_user && (type == Type::SEQPACKET || type == Type::RAW)) {
if (type == Type::RAW && domain == Domain::INET && protocol == Protocol::ICMP) {
// fine, can use on bsd:s and bsd:u
} else {
return {-1, Errno::INVAL};
}
}
[[maybe_unused]] const bool unk_flag = (static_cast<u32>(type) & 0x20000000) != 0;
@@ -1052,14 +1080,15 @@ void BSD::OnProxyPacketReceived(const Network::ProxyPacket& packet) {
}
}
BSD::BSD(Core::System& system_, const char* name)
: ServiceFramework{system_, name} {
BSD::BSD(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::RegisterClient, "RegisterClient"},
{1, &BSD::StartMonitoring, "StartMonitoring"},
{2, &BSD::Socket, "Socket"},
{3, nullptr, "SocketExempt"},
{3, &BSD::SocketExempt, "SocketExempt"},
{4, nullptr, "Open"},
{5, &BSD::Select, "Select"},
{6, &BSD::Poll, "Poll"},
@@ -1125,7 +1154,8 @@ std::unique_lock<std::mutex> BSD::LockService() noexcept {
return {};
}
BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} {
BSDCFG::BSDCFG(Core::System& system_, const char *name)
: ServiceFramework{system_, name} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "SetIfUp"},
@@ -1152,4 +1182,16 @@ BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} {
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;
} // namespace Service::Sockets
+11 -4
View File
@@ -29,7 +29,7 @@ namespace Service::Sockets {
class BSD final : public ServiceFramework<BSD> {
public:
explicit BSD(Core::System& system_, const char* name);
explicit BSD(Core::System& system_, const char* name, bool is_user);
~BSD() override;
// These methods are called from SSL; the first two are also called from
@@ -129,6 +129,7 @@ private:
void RegisterClient(HLERequestContext& ctx);
void StartMonitoring(HLERequestContext& ctx);
void Socket(HLERequestContext& ctx);
void SocketExempt(HLERequestContext& ctx);
void Select(HLERequestContext& ctx);
void Poll(HLERequestContext& ctx);
void Accept(HLERequestContext& ctx);
@@ -155,8 +156,7 @@ private:
void ExecuteWork(HLERequestContext& ctx, Work work);
std::pair<s32, Errno> SocketImpl(Domain domain, Type type, Protocol protocol);
std::pair<s32, Errno> PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer,
s32 nfds, s32 timeout);
std::pair<s32, Errno> PollImpl(std::vector<u8>& write_buffer, std::span<const u8> read_buffer, s32 nfds, s32 timeout);
std::pair<s32, Errno> AcceptImpl(s32 fd, std::vector<u8>& write_buffer);
Errno BindImpl(s32 fd, std::span<const u8> addr);
Errno ConnectImpl(s32 fd, std::span<const u8> addr);
@@ -189,12 +189,19 @@ private:
protected:
std::unique_lock<std::mutex> LockService() noexcept override;
bool is_user = false;
};
class BSDCFG final : public ServiceFramework<BSDCFG> {
public:
explicit BSDCFG(Core::System& system_);
explicit BSDCFG(Core::System& system_, const char *name);
~BSDCFG() override;
};
class BSD_NU final : public ServiceFramework<BSD_NU> {
public:
explicit BSD_NU(Core::System& system_);
~BSD_NU() override;
};
} // namespace Service::Sockets
+17
View File
@@ -406,4 +406,21 @@ void SFDNSRES::ResolverSetOptionRequest(HLERequestContext& ctx) {
rb.Push(ResultSuccess);
rb.Push<s32>(0); // bsd errno
}
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;
} // namespace Service::Sockets
+9
View File
@@ -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
@@ -25,4 +28,10 @@ private:
void ResolverSetOptionRequest(HLERequestContext& ctx);
};
class DNS_PRIV final : public ServiceFramework<DNS_PRIV> {
public:
explicit DNS_PRIV(Core::System& system_);
~DNS_PRIV() override;
};
} // namespace Service::Sockets
+63 -3
View File
@@ -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,15 +12,72 @@
namespace Service::Sockets {
class ETHC_C final : public ServiceFramework<ETHC_C> {
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);
}
};
class ETHC_I final : public ServiceFramework<ETHC_I> {
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);
}
};
class ISfDriverServiceCreator final : public ServiceFramework<ISfDriverServiceCreator> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("bsd:s", std::make_shared<BSD>(system, "bsd:s"));
server_manager->RegisterNamedService("bsd:u", std::make_shared<BSD>(system, "bsd:u"));
server_manager->RegisterNamedService("bsdcfg", std::make_shared<BSDCFG>(system));
server_manager->RegisterNamedService("ethc:c", std::make_shared<ETHC_C>(system));
server_manager->RegisterNamedService("ethc:i", std::make_shared<ETHC_I>(system));
server_manager->RegisterNamedService("bsd:s", std::make_shared<BSD>(system, "bsd:s", false));
server_manager->RegisterNamedService("bsd:u", std::make_shared<BSD>(system, "bsd:u", true));
server_manager->RegisterNamedService("bsd:a", std::make_shared<BSD>(system, "bsd:a", true));
server_manager->RegisterNamedService("bsd:nu", std::make_shared<BSD_NU>(system));
server_manager->RegisterNamedService("bsdcfg", std::make_shared<BSDCFG>(system, "bsdcfg"));
server_manager->RegisterNamedService("ifcfg", std::make_shared<BSDCFG>(system, "ifcfg"));
server_manager->RegisterNamedService("nsd:a", std::make_shared<NSD>(system, "nsd:a"));
server_manager->RegisterNamedService("nsd:u", std::make_shared<NSD>(system, "nsd:u"));
server_manager->RegisterNamedService("sfdnsres", std::make_shared<SFDNSRES>(system));
server_manager->RegisterNamedService("dns:priv", std::make_shared<DNS_PRIV>(system));
server_manager->RegisterNamedService("eth:nd", std::make_shared<ISfDriverServiceCreator>(system));
server_manager->StartAdditionalHostThreads("bsdsocket", 2);
ServerManager::RunServer(std::move(server_manager));
}
+10 -10
View File
@@ -25,6 +25,8 @@ SPL::SPL(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL::~SPL() = default;
SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:mig") {
// clang-format off
@@ -51,6 +53,8 @@ SPL_MIG::SPL_MIG(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL_MIG::~SPL_MIG() = default;
SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:fs") {
// clang-format off
@@ -82,6 +86,8 @@ SPL_FS::SPL_FS(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL_FS::~SPL_FS() = default;
SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:ssl") {
// clang-format off
@@ -111,6 +117,8 @@ SPL_SSL::SPL_SSL(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL_SSL::~SPL_SSL() = default;
SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:es") {
// clang-format off
@@ -145,6 +153,8 @@ SPL_ES::SPL_ES(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL_ES::~SPL_ES() = default;
SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
: Interface(system_, std::move(module_), "spl:manu") {
// clang-format off
@@ -173,16 +183,6 @@ SPL_MANU::SPL_MANU(Core::System& system_, std::shared_ptr<Module> module_)
RegisterHandlers(functions);
}
SPL::~SPL() = default;
SPL_MIG::~SPL_MIG() = default;
SPL_FS::~SPL_FS() = default;
SPL_SSL::~SPL_SSL() = default;
SPL_ES::~SPL_ES() = default;
SPL_MANU::~SPL_MANU() = default;
} // namespace Service::SPL
+3
View File
@@ -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
+36
View File
@@ -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
#include "core/core.h"
#include "core/hle/result.h"
#include "core/hle/service/tma/tma.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h"
#include "core/hle/service/server_manager.h"
namespace Service::TMA {
class HTC_TENV final : public ServiceFramework<HTC_TENV> {
public:
explicit HTC_TENV(Core::System& system_)
: ServiceFramework{system_, "htc:tenv"}
{
static const FunctionInfo functions[] = {
{0, nullptr, "GetServiceInterface"},
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("htc:tenv", std::make_shared<HTC_TENV>(system));
ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::TMA
+15
View File
@@ -0,0 +1,15 @@
// 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
namespace Core {
class System;
}
namespace Service::TMA {
void LoopProcess(Core::System& system);
} // namespace Service::TMA
+48
View File
@@ -11,6 +11,7 @@
#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#include "core/hle/service/usb/usb.h"
#include "frontend_common/firmware_manager.h"
namespace Service::USB {
@@ -221,6 +222,44 @@ public:
}
};
class IPdManufactureManager final : public ServiceFramework<IPdManufactureManager> {
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);
}
};
class IQdbManager final : public ServiceFramework<IQdbManager> {
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);
}
};
class IPmObserverService final : public ServiceFramework<IPmObserverService> {
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);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
@@ -228,7 +267,16 @@ void LoopProcess(Core::System& system) {
server_manager->RegisterNamedService("usb:hs", std::make_shared<IClientRootSession>(system));
server_manager->RegisterNamedService("usb:pd", std::make_shared<IPdManager>(system));
server_manager->RegisterNamedService("usb:pd:c", std::make_shared<IPdCradleManager>(system));
server_manager->RegisterNamedService("usb:pd:m", std::make_shared<IPdManufactureManager>(system));
server_manager->RegisterNamedService("usb:pm", std::make_shared<IPmMainService>(system));
// +7.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 7) {
server_manager->RegisterNamedService("usb:qdb", std::make_shared<IQdbManager>(system));
}
// +8.0.0
if (FirmwareManager::GetFirmwareVersion(system).first.major >= 8) {
server_manager->RegisterNamedService("usb:obsv", std::make_shared<IPmObserverService>(system));
}
ServerManager::RunServer(std::move(server_manager));
}
+260
View File
@@ -0,0 +1,260 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/core.h"
#include "core/hle/result.h"
#include "core/hle/service/wlan/wlan.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/cmif_types.h"
#include "core/hle/service/service.h"
#include "core/hle/service/server_manager.h"
namespace Service::WLAN {
class ILocalManager final : public ServiceFramework<ILocalManager> {
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);
}
};
class ILocalGetFrame final : public ServiceFramework<ILocalGetFrame> {
public:
explicit ILocalGetFrame(Core::System& system_)
: ServiceFramework{system_, "wlan:lg"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "GetFrameRaw" },
};
RegisterHandlers(functions);
}
};
class ILocalGetActionFrame final : public ServiceFramework<ILocalGetActionFrame> {
public:
explicit ILocalGetActionFrame(Core::System& system_)
: ServiceFramework{system_, "wlan:lga"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "GetActionFrame" },
};
RegisterHandlers(functions);
}
};
class ISocketGetFrame final : public ServiceFramework<ISocketGetFrame> {
public:
explicit ISocketGetFrame(Core::System& system_)
: ServiceFramework{system_, "wlan:sg"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "GetFrameRaw" },
};
RegisterHandlers(functions);
}
};
class ISocketManager final : public ServiceFramework<ISocketManager> {
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);
}
};
class IDetectManager final : public ServiceFramework<IDetectManager> {
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);
}
};
class IPrivateServiceCreator final : public ServiceFramework<IPrivateServiceCreator> {
public:
explicit IPrivateServiceCreator(Core::System& system_)
: ServiceFramework{system_, "wlan:p"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "CreateWirelessCommunicationService" },
{ 1, nullptr, "CreatePrivateWirelessCommunicationService" },
};
RegisterHandlers(functions);
}
};
class ISfDriverServiceCreator final : public ServiceFramework<ISfDriverServiceCreator> {
public:
explicit ISfDriverServiceCreator(Core::System& system_)
: ServiceFramework{system_, "wlan:nd"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "CreateDriverService" },
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("wlan:lcl", std::make_shared<ILocalManager>(system));
server_manager->RegisterNamedService("wlan:lg", std::make_shared<ILocalGetFrame>(system));
server_manager->RegisterNamedService("wlan:lga", std::make_shared<ILocalGetActionFrame>(system));
server_manager->RegisterNamedService("wlan:sg", std::make_shared<ISocketGetFrame>(system));
server_manager->RegisterNamedService("wlan:soc", std::make_shared<ISocketManager>(system));
server_manager->RegisterNamedService("wlan:dtc", std::make_shared<IDetectManager>(system));
server_manager->RegisterNamedService("wlan:p", std::make_shared<IPrivateServiceCreator>(system));
server_manager->RegisterNamedService("wlan:nd", std::make_shared<ISfDriverServiceCreator>(system));
ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::WLAN
+12
View File
@@ -0,0 +1,12 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
namespace Core {
class System;
}
namespace Service::WLAN {
void LoopProcess(Core::System& system);
} // namespace Service::WLAN
@@ -53,12 +53,11 @@ Result NpadAbstractBatteryHandler::DecrementRefCounter() {
Result NpadAbstractBatteryHandler::UpdateBatteryState(u64 aruid) {
const auto npad_index = NpadIdTypeToIndex(properties_handler->GetNpadId());
AruidData* aruid_data = applet_resource_holder->applet_resource->GetAruidData(aruid);
if (aruid_data == nullptr) {
if (aruid_data == nullptr || aruid_data->shared_memory_format == nullptr) {
return ResultSuccess;
}
auto& npad_internal_state =
aruid_data->shared_memory_format->npad.npad_entry[npad_index].internal_state;
auto& npad_internal_state = aruid_data->shared_memory_format->npad.npad_entry[npad_index].internal_state;
auto& system_properties = npad_internal_state.system_properties;
system_properties.is_charging_joy_dual.Assign(dual_battery.is_charging);
+10 -3
View File
@@ -80,7 +80,11 @@ Result NPad::Activate(u64 aruid) {
std::scoped_lock shared_lock{*applet_resource_holder.shared_mutex};
auto* data = applet_resource_holder.applet_resource->GetAruidData(aruid);
const auto aruid_index = applet_resource_holder.applet_resource->GetIndexFromAruid(aruid);
auto aruid_index = applet_resource_holder.applet_resource->GetIndexFromAruid(aruid);
if (aruid_index >= AruidIndexMax) {
LOG_ERROR(Service_HID, "Invalid aruid:{:016X}", aruid);
aruid_index = 0;
}
if (data == nullptr || !data->flag.is_assigned) {
return ResultSuccess;
@@ -1099,13 +1103,16 @@ Result NPad::RegisterAppletResourceUserId(u64 aruid) {
void NPad::UnregisterAppletResourceUserId(u64 aruid) {
// TODO: Remove this once abstract pad is emulated properly
const auto aruid_index = npad_resource.GetIndexFromAruid(aruid);
auto aruid_index = npad_resource.GetIndexFromAruid(aruid);
if (aruid_index >= AruidIndexMax) {
LOG_ERROR(Service_HID, "Invalid aruid:{:016X}", aruid);
aruid_index = 0;
}
for (auto& controller : controller_data[aruid_index]) {
controller.is_active = false;
controller.is_connected = false;
controller.shared_memory = nullptr;
}
npad_resource.UnregisterAppletResourceUserId(aruid);
}
@@ -71,6 +71,9 @@ Result NPadResource::RegisterAppletResourceUserId(u64 aruid) {
void NPadResource::UnregisterAppletResourceUserId(u64 aruid) {
const u64 aruid_index = GetIndexFromAruid(aruid);
if (aruid_index >= AruidIndexMax) {
return;
}
FreeAppletResourceId(aruid);
if (aruid_index < AruidIndexMax) {
-32
View File
@@ -267,38 +267,6 @@ add_library(video_core STATIC
video_core.h
)
if (ENABLE_LSFG)
target_sources(video_core PRIVATE
frame_gen/lossless_dll.cpp
frame_gen/lossless_dll.h
frame_gen/lsfg_translate.cpp
frame_gen/lsfg_translate.h
renderer_vulkan/present/frame_gen.cpp
renderer_vulkan/present/frame_gen.h
renderer_vulkan/present/frame_gen_pacer.cpp
renderer_vulkan/present/frame_gen_pacer.h
renderer_vulkan/present/lsfg_alpha.cpp
renderer_vulkan/present/lsfg_alpha.h
renderer_vulkan/present/lsfg_beta.cpp
renderer_vulkan/present/lsfg_beta.h
renderer_vulkan/present/lsfg_chain.cpp
renderer_vulkan/present/lsfg_chain.h
renderer_vulkan/present/lsfg_common.cpp
renderer_vulkan/present/lsfg_common.h
renderer_vulkan/present/lsfg_delta.cpp
renderer_vulkan/present/lsfg_delta.h
renderer_vulkan/present/lsfg_gamma.cpp
renderer_vulkan/present/lsfg_gamma.h
renderer_vulkan/present/lsfg_generate.cpp
renderer_vulkan/present/lsfg_generate.h
renderer_vulkan/present/lsfg_mipmaps.cpp
renderer_vulkan/present/lsfg_mipmaps.h
renderer_vulkan/present/lsfg_shaders.cpp
renderer_vulkan/present/lsfg_shaders.h
)
target_compile_definitions(video_core PUBLIC HAS_LSFG)
endif()
if (ENABLE_OPENGL)
target_sources(video_core PRIVATE
renderer_opengl/present/filters.cpp
-553
View File
@@ -1,553 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <algorithm>
#include <cstring>
#include <optional>
#include <span>
#include "common/cityhash.h"
#include "common/fs/file.h"
#include "common/fs/fs.h"
#include "common/fs/fs_paths.h"
#include "common/fs/path_util.h"
#include "video_core/frame_gen/lossless_dll.h"
#include "video_core/frame_gen/lsfg_translate.h"
namespace VideoCore::FrameGen {
namespace {
constexpr u16 DOS_MAGIC = 0x5A4D;
constexpr u32 PE_SIGNATURE = 0x00004550;
constexpr u16 PE32_MAGIC = 0x010B;
constexpr u16 PE32_PLUS_MAGIC = 0x020B;
constexpr size_t DOS_LFANEW_OFFSET = 0x3C;
constexpr size_t COFF_HEADER_SIZE = 20;
constexpr size_t OPTIONAL_HEADER_SIZE_OFFSET = 16;
constexpr size_t SECTION_HEADER_SIZE = 40;
constexpr size_t DATA_DIRECTORY_ENTRY_SIZE = 8;
constexpr size_t DATA_DIRECTORY_OFFSET_PE32 = 96;
constexpr size_t DATA_DIRECTORY_OFFSET_PE32_PLUS = 112;
constexpr size_t RESOURCE_DATA_DIRECTORY_INDEX = 2;
constexpr size_t RESOURCE_DIRECTORY_SIZE = 16;
constexpr size_t RESOURCE_NAMED_COUNT_OFFSET = 12;
constexpr size_t RESOURCE_ID_COUNT_OFFSET = 14;
constexpr size_t RESOURCE_ENTRY_SIZE = 8;
constexpr u32 RESOURCE_SUBDIRECTORY_FLAG = 0x80000000;
constexpr u32 RESOURCE_TYPE_RCDATA = 10;
constexpr u32 MIPMAPS_SHADER_ID = 255;
constexpr u32 GENERATE_SHADER_ID = 256;
constexpr u32 PERFORMANCE_SHADER_ID_FIRST = 280;
constexpr u32 PERFORMANCE_SHADER_ID_LAST = 302;
constexpr u32 CACHE_MAGIC = 0x4746534C;
constexpr u32 CACHE_VERSION = 2;
struct CacheHeader {
u32 magic;
u32 version;
u64 source_size;
u64 source_hash;
u32 module_count;
u32 variant;
};
struct Section {
u32 virtual_address;
u32 virtual_size;
u32 raw_address;
u32 raw_size;
};
struct ResourceEntry {
u32 id;
u32 offset;
bool is_directory;
bool is_named;
};
class ImageReader {
public:
explicit ImageReader(std::span<const u8> image_) : image{image_} {}
template <typename T>
[[nodiscard]] bool Read(size_t offset, T& out_value) const {
if (offset > image.size() || image.size() - offset < sizeof(T)) {
return false;
}
std::memcpy(&out_value, image.data() + offset, sizeof(T));
return true;
}
[[nodiscard]] bool Slice(size_t offset, size_t size, std::span<const u8>& out_slice) const {
if (offset > image.size() || image.size() - offset < size) {
return false;
}
out_slice = image.subspan(offset, size);
return true;
}
private:
std::span<const u8> image;
};
[[nodiscard]] std::optional<size_t> FindPeHeader(const ImageReader& reader) {
u16 dos_magic{};
if (!reader.Read(0, dos_magic) || dos_magic != DOS_MAGIC) {
return std::nullopt;
}
u32 pe_offset{};
if (!reader.Read(DOS_LFANEW_OFFSET, pe_offset)) {
return std::nullopt;
}
u32 pe_signature{};
if (!reader.Read(pe_offset, pe_signature) || pe_signature != PE_SIGNATURE) {
return std::nullopt;
}
return static_cast<size_t>(pe_offset);
}
[[nodiscard]] std::optional<size_t> FindDataDirectory(const ImageReader& reader,
size_t optional_header_offset) {
u16 optional_magic{};
if (!reader.Read(optional_header_offset, optional_magic)) {
return std::nullopt;
}
switch (optional_magic) {
case PE32_MAGIC:
return optional_header_offset + DATA_DIRECTORY_OFFSET_PE32;
case PE32_PLUS_MAGIC:
return optional_header_offset + DATA_DIRECTORY_OFFSET_PE32_PLUS;
default:
return std::nullopt;
}
}
[[nodiscard]] bool ReadSections(const ImageReader& reader, size_t pe_offset,
std::vector<Section>& out_sections) {
u16 section_count{};
u16 optional_header_size{};
if (!reader.Read(pe_offset + 4 + 2, section_count) ||
!reader.Read(pe_offset + 4 + OPTIONAL_HEADER_SIZE_OFFSET, optional_header_size)) {
return false;
}
const size_t table_offset = pe_offset + 4 + COFF_HEADER_SIZE + optional_header_size;
out_sections.reserve(section_count);
for (size_t i = 0; i < section_count; ++i) {
const size_t offset = table_offset + i * SECTION_HEADER_SIZE;
Section section{};
if (!reader.Read(offset + 8, section.virtual_size) ||
!reader.Read(offset + 12, section.virtual_address) ||
!reader.Read(offset + 16, section.raw_size) ||
!reader.Read(offset + 20, section.raw_address)) {
return false;
}
out_sections.push_back(section);
}
return true;
}
[[nodiscard]] std::optional<size_t> RvaToFileOffset(std::span<const Section> sections, u32 rva) {
for (const Section& section : sections) {
const u32 span = std::max(section.virtual_size, section.raw_size);
if (span == 0 || rva < section.virtual_address) {
continue;
}
const u32 relative = rva - section.virtual_address;
if (relative < span) {
return static_cast<size_t>(section.raw_address) + relative;
}
}
return std::nullopt;
}
[[nodiscard]] bool ReadResourceEntries(const ImageReader& reader, size_t directory_offset,
std::vector<ResourceEntry>& out_entries) {
u16 named_count{};
u16 id_count{};
if (!reader.Read(directory_offset + RESOURCE_NAMED_COUNT_OFFSET, named_count) ||
!reader.Read(directory_offset + RESOURCE_ID_COUNT_OFFSET, id_count)) {
return false;
}
const size_t total = size_t{named_count} + size_t{id_count};
out_entries.clear();
out_entries.reserve(total);
for (size_t i = 0; i < total; ++i) {
const size_t offset = directory_offset + RESOURCE_DIRECTORY_SIZE + i * RESOURCE_ENTRY_SIZE;
u32 name{};
u32 data{};
if (!reader.Read(offset, name) || !reader.Read(offset + 4, data)) {
return false;
}
out_entries.push_back(ResourceEntry{
.id = name & ~RESOURCE_SUBDIRECTORY_FLAG,
.offset = data & ~RESOURCE_SUBDIRECTORY_FLAG,
.is_directory = (data & RESOURCE_SUBDIRECTORY_FLAG) != 0,
.is_named = (name & RESOURCE_SUBDIRECTORY_FLAG) != 0,
});
}
return true;
}
[[nodiscard]] bool ReadResourceLeaf(const ImageReader& reader, std::span<const Section> sections,
size_t leaf_offset, std::span<const u8>& out_data) {
u32 data_rva{};
u32 data_size{};
if (!reader.Read(leaf_offset, data_rva) || !reader.Read(leaf_offset + 4, data_size) ||
data_size == 0) {
return false;
}
const std::optional<size_t> data_offset = RvaToFileOffset(sections, data_rva);
if (!data_offset) {
return false;
}
return reader.Slice(*data_offset, data_size, out_data);
}
using ResourceSpans = std::map<u32, std::span<const u8>>;
[[nodiscard]] bool CollectRcData(const ImageReader& reader, std::span<const Section> sections,
size_t resource_base, ResourceSpans& out_resources) {
std::vector<ResourceEntry> type_entries;
if (!ReadResourceEntries(reader, resource_base, type_entries)) {
return false;
}
for (const ResourceEntry& type_entry : type_entries) {
if (type_entry.is_named || type_entry.id != RESOURCE_TYPE_RCDATA ||
!type_entry.is_directory) {
continue;
}
std::vector<ResourceEntry> name_entries;
if (!ReadResourceEntries(reader, resource_base + type_entry.offset, name_entries)) {
return false;
}
for (const ResourceEntry& name_entry : name_entries) {
if (name_entry.is_named || !name_entry.is_directory) {
continue;
}
std::vector<ResourceEntry> language_entries;
if (!ReadResourceEntries(reader, resource_base + name_entry.offset, language_entries)) {
return false;
}
for (const ResourceEntry& language_entry : language_entries) {
if (language_entry.is_directory) {
continue;
}
std::span<const u8> data;
if (!ReadResourceLeaf(reader, sections, resource_base + language_entry.offset,
data)) {
continue;
}
out_resources.insert_or_assign(name_entry.id, data);
break;
}
}
}
return true;
}
[[nodiscard]] std::vector<u32> PerformanceShaderIds() {
std::vector<u32> ids{MIPMAPS_SHADER_ID, GENERATE_SHADER_ID};
for (u32 id = PERFORMANCE_SHADER_ID_FIRST; id <= PERFORMANCE_SHADER_ID_LAST; ++id) {
ids.push_back(id);
}
return ids;
}
template <typename Map>
[[nodiscard]] bool HasPerformanceShaders(const Map& resources) {
const std::vector<u32> ids = PerformanceShaderIds();
return std::ranges::all_of(ids, [&](u32 id) { return resources.contains(id); });
}
[[nodiscard]] u32 VariantOffset(ShaderVariant variant) {
return variant == ShaderVariant::NativeFp16 ? PerformanceShader::NATIVE_FP16_OFFSET
: PerformanceShader::NATIVE_FP32_OFFSET;
}
template <typename Map>
[[nodiscard]] bool HasNativeVariant(const Map& resources, ShaderVariant variant) {
const u32 offset = VariantOffset(variant);
return std::ranges::all_of(PerformanceShaderIds(), [&](u32 id) {
const auto hit = resources.find(id + offset);
return hit != resources.end() && IsSpirvModule(hit->second);
});
}
[[nodiscard]] std::optional<ShaderVariant> SelectVariant(const ResourceSpans& resources,
bool allow_fp16, bool prefer_fp16) {
if (prefer_fp16 && HasNativeVariant(resources, ShaderVariant::NativeFp16)) {
return ShaderVariant::NativeFp16;
}
if (HasNativeVariant(resources, ShaderVariant::NativeFp32)) {
return ShaderVariant::NativeFp32;
}
if (allow_fp16 && HasNativeVariant(resources, ShaderVariant::NativeFp16)) {
return ShaderVariant::NativeFp16;
}
return std::nullopt;
}
[[nodiscard]] LosslessStatus TranslateAll(const ResourceSpans& resources,
ShaderModules& out_modules,
ShaderVariant variant) {
const u32 offset = VariantOffset(variant);
out_modules.clear();
for (const u32 id : PerformanceShaderIds()) {
const auto hit = resources.find(id + offset);
if (hit == resources.end()) {
return LosslessStatus::MissingShaders;
}
std::vector<u32> adopted = AdoptSpirvModule(hit->second);
if (adopted.empty()) {
return LosslessStatus::TranslationFailed;
}
out_modules.emplace(id, std::move(adopted));
}
return LosslessStatus::Ok;
}
[[nodiscard]] bool WriteShaderCache(const std::filesystem::path& path, const CacheHeader& header,
const ShaderModules& modules) {
Common::FS::IOFile file{path, Common::FS::FileAccessMode::Write,
Common::FS::FileType::BinaryFile};
if (!file.IsOpen() || file.Write(header) != 1) {
return false;
}
for (const auto& [id, words] : modules) {
const u32 word_count = static_cast<u32>(words.size());
if (file.Write(id) != 1 || file.Write(word_count) != 1 ||
file.Write(words) != words.size()) {
return false;
}
}
return file.Flush();
}
[[nodiscard]] bool ReadShaderCache(const std::filesystem::path& path, u64 source_size,
u64 source_hash, u32 variant, ShaderModules& out_modules) {
if (!Common::FS::Exists(path)) {
return false;
}
Common::FS::IOFile file{path, Common::FS::FileAccessMode::Read,
Common::FS::FileType::BinaryFile};
CacheHeader header{};
if (!file.IsOpen() || file.Read(header) != 1) {
return false;
}
if (header.magic != CACHE_MAGIC || header.version != CACHE_VERSION ||
header.source_size != source_size || header.source_hash != source_hash ||
header.variant != variant) {
return false;
}
out_modules.clear();
for (u32 i = 0; i < header.module_count; ++i) {
u32 id{};
u32 word_count{};
if (file.Read(id) != 1 || file.Read(word_count) != 1 || word_count == 0) {
return false;
}
std::vector<u32> words(word_count);
if (file.Read(words) != words.size()) {
return false;
}
out_modules.emplace(id, std::move(words));
}
return HasPerformanceShaders(out_modules);
}
[[nodiscard]] LosslessStatus ReadImageFile(const std::filesystem::path& path,
std::vector<u8>& out_image) {
if (!Common::FS::Exists(path)) {
return LosslessStatus::NotInstalled;
}
Common::FS::IOFile file{path, Common::FS::FileAccessMode::Read,
Common::FS::FileType::BinaryFile};
if (!file.IsOpen()) {
return LosslessStatus::UnreadableFile;
}
out_image.resize(static_cast<size_t>(file.GetSize()));
if (out_image.empty() || file.Read(out_image) != out_image.size()) {
return LosslessStatus::UnreadableFile;
}
return LosslessStatus::Ok;
}
[[nodiscard]] LosslessStatus ParseShaderSpans(std::span<const u8> image,
ResourceSpans& out_resources) {
const ImageReader reader{image};
const std::optional<size_t> pe_offset = FindPeHeader(reader);
if (!pe_offset) {
return LosslessStatus::NotPortableExecutable;
}
const std::optional<size_t> data_directory =
FindDataDirectory(reader, *pe_offset + 4 + COFF_HEADER_SIZE);
if (!data_directory) {
return LosslessStatus::NotPortableExecutable;
}
std::vector<Section> sections;
if (!ReadSections(reader, *pe_offset, sections)) {
return LosslessStatus::NotPortableExecutable;
}
u32 resource_rva{};
if (!reader.Read(*data_directory + RESOURCE_DATA_DIRECTORY_INDEX * DATA_DIRECTORY_ENTRY_SIZE,
resource_rva) ||
resource_rva == 0) {
return LosslessStatus::MissingShaders;
}
const std::optional<size_t> resource_base = RvaToFileOffset(sections, resource_rva);
if (!resource_base) {
return LosslessStatus::NotPortableExecutable;
}
out_resources.clear();
if (!CollectRcData(reader, sections, *resource_base, out_resources)) {
return LosslessStatus::MissingShaders;
}
return HasPerformanceShaders(out_resources) ? LosslessStatus::Ok
: LosslessStatus::MissingShaders;
}
} // Anonymous namespace
std::filesystem::path GetLosslessDllPath() {
return Common::FS::GetEdenPath(Common::FS::EdenPath::LosslessDir) / LOSSLESS_DLL_FILE;
}
std::filesystem::path GetShaderCachePath() {
return Common::FS::GetEdenPath(Common::FS::EdenPath::LosslessDir) / LOSSLESS_CACHE_FILE;
}
LosslessStatus ReadShaderResources(const std::filesystem::path& path,
ShaderResources& out_resources) {
std::vector<u8> image;
const LosslessStatus read_status = ReadImageFile(path, image);
if (read_status != LosslessStatus::Ok) {
return read_status;
}
ResourceSpans spans;
const LosslessStatus parse_status = ParseShaderSpans(image, spans);
if (parse_status != LosslessStatus::Ok) {
return parse_status;
}
out_resources.clear();
for (const auto& [id, data] : spans) {
out_resources.emplace(id, std::vector<u8>{data.begin(), data.end()});
}
return LosslessStatus::Ok;
}
LosslessStatus ValidateLosslessDll(const std::filesystem::path& path) {
std::vector<u8> image;
const LosslessStatus read_status = ReadImageFile(path, image);
if (read_status != LosslessStatus::Ok) {
return read_status;
}
ResourceSpans spans;
return ParseShaderSpans(image, spans);
}
LosslessStatus GetInstalledLosslessStatus() {
return ValidateLosslessDll(GetLosslessDllPath());
}
LosslessStatus LoadShaderModules(ShaderModules& out_modules, bool allow_fp16, bool prefer_fp16) {
std::vector<u8> image;
const LosslessStatus read_status = ReadImageFile(GetLosslessDllPath(), image);
if (read_status != LosslessStatus::Ok) {
return read_status;
}
const u64 source_size = image.size();
const u64 source_hash =
Common::CityHash64(reinterpret_cast<const char*>(image.data()), image.size());
const std::filesystem::path cache_path = GetShaderCachePath();
ResourceSpans spans;
const LosslessStatus parse_status = ParseShaderSpans(image, spans);
if (parse_status != LosslessStatus::Ok) {
return parse_status;
}
const std::optional<ShaderVariant> variant = SelectVariant(spans, allow_fp16, prefer_fp16);
if (!variant) {
return LosslessStatus::MissingShaders;
}
if (ReadShaderCache(cache_path, source_size, source_hash, static_cast<u32>(*variant),
out_modules)) {
return LosslessStatus::Ok;
}
const LosslessStatus translate_status = TranslateAll(spans, out_modules, *variant);
if (translate_status != LosslessStatus::Ok) {
return translate_status;
}
const CacheHeader header{
.magic = CACHE_MAGIC,
.version = CACHE_VERSION,
.source_size = source_size,
.source_hash = source_hash,
.module_count = static_cast<u32>(out_modules.size()),
.variant = static_cast<u32>(*variant),
};
if (!WriteShaderCache(cache_path, header, out_modules)) {
void(Common::FS::RemoveFile(cache_path));
return LosslessStatus::CacheUnusable;
}
return LosslessStatus::Ok;
}
LosslessStatus BuildShaderCache() {
ShaderModules modules;
return LoadShaderModules(modules, true);
}
bool RemoveInstalledLosslessDll() {
const std::filesystem::path cache_path = GetShaderCachePath();
if (Common::FS::Exists(cache_path)) {
void(Common::FS::RemoveFile(cache_path));
}
const std::filesystem::path path = GetLosslessDllPath();
if (!Common::FS::Exists(path)) {
return true;
}
return Common::FS::RemoveFile(path);
}
} // namespace VideoCore::FrameGen
-67
View File
@@ -1,67 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2025 lsfg-vk
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <array>
#include <filesystem>
#include <map>
#include <vector>
#include "common/common_types.h"
namespace VideoCore::FrameGen {
enum class LosslessStatus : u32 {
Ok,
NotInstalled,
UnreadableFile,
NotPortableExecutable,
MissingShaders,
TranslationFailed,
CacheUnusable,
};
using ShaderResources = std::map<u32, std::vector<u8>>;
using ShaderModules = std::map<u32, std::vector<u32>>;
enum class ShaderVariant : u32 {
NativeFp32 = 1,
NativeFp16 = 2,
};
namespace PerformanceShader {
constexpr u32 MIPMAPS = 255;
constexpr u32 GENERATE = 256;
constexpr std::array<u32, 4> ALPHA{290, 291, 292, 293};
constexpr std::array<u32, 5> BETA{298, 299, 300, 301, 302};
constexpr std::array<u32, 5> GAMMA{280, 282, 283, 284, 285};
constexpr std::array<u32, 10> DELTA{280, 286, 287, 288, 289, 281, 294, 295, 296, 297};
constexpr u32 NATIVE_FP16_OFFSET = 49;
constexpr u32 NATIVE_FP32_OFFSET = 98;
} // namespace PerformanceShader
[[nodiscard]] std::filesystem::path GetLosslessDllPath();
[[nodiscard]] std::filesystem::path GetShaderCachePath();
[[nodiscard]] LosslessStatus ReadShaderResources(const std::filesystem::path& path,
ShaderResources& out_resources);
[[nodiscard]] LosslessStatus ValidateLosslessDll(const std::filesystem::path& path);
[[nodiscard]] LosslessStatus GetInstalledLosslessStatus();
[[nodiscard]] LosslessStatus BuildShaderCache();
[[nodiscard]] LosslessStatus LoadShaderModules(ShaderModules& out_modules,
bool allow_fp16 = false,
bool prefer_fp16 = false);
bool RemoveInstalledLosslessDll();
} // namespace VideoCore::FrameGen
@@ -1,93 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <algorithm>
#include <cstring>
#include <map>
#include <tuple>
#include "video_core/frame_gen/lsfg_translate.h"
namespace VideoCore::FrameGen {
namespace {
constexpr u32 SPIRV_MAGIC = 0x07230203;
constexpr u32 SPIRV_WORD_COUNT_SHIFT = 16;
constexpr u32 SPIRV_OPCODE_MASK = 0xffff;
constexpr u32 SPIRV_OP_FUNCTION = 54;
constexpr u32 SPIRV_OP_DECORATE = 71;
constexpr u32 SPIRV_DECORATION_BINDING = 33;
constexpr u32 SPIRV_DECORATION_DESCRIPTOR_SET = 34;
constexpr u32 DECORATION_LITERAL_WORD = 3;
constexpr size_t SPIRV_HEADER_WORDS = 5;
void RenumberBindingsInOrder(std::vector<u32>& words) {
struct Slot {
u32 set;
u32 binding;
size_t literal_offset;
};
std::map<u32, u32> sets;
std::vector<Slot> slots;
size_t offset = SPIRV_HEADER_WORDS;
while (offset + 1 <= words.size()) {
const u32 length = words[offset] >> SPIRV_WORD_COUNT_SHIFT;
const u32 opcode = words[offset] & SPIRV_OPCODE_MASK;
if (length == 0 || offset + length > words.size()) {
return;
}
if (opcode == SPIRV_OP_FUNCTION) {
break;
}
if (opcode == SPIRV_OP_DECORATE && length >= 4) {
if (words[offset + 2] == SPIRV_DECORATION_DESCRIPTOR_SET) {
sets[words[offset + 1]] = words[offset + 3];
} else if (words[offset + 2] == SPIRV_DECORATION_BINDING) {
slots.push_back(Slot{0, words[offset + 3], offset + DECORATION_LITERAL_WORD});
}
}
offset += length;
}
for (Slot& slot : slots) {
const auto hit = sets.find(words[slot.literal_offset - 2]);
slot.set = hit == sets.end() ? 0 : hit->second;
}
std::ranges::stable_sort(slots, [](const Slot& lhs, const Slot& rhs) {
return std::tie(lhs.set, lhs.binding) < std::tie(rhs.set, rhs.binding);
});
for (size_t i = 0; i < slots.size(); ++i) {
words[slots[i].literal_offset] = static_cast<u32>(i);
}
}
} // Anonymous namespace
bool IsSpirvModule(std::span<const u8> blob) {
if (blob.size() < SPIRV_HEADER_WORDS * sizeof(u32) || blob.size() % sizeof(u32) != 0) {
return false;
}
u32 magic{};
std::memcpy(&magic, blob.data(), sizeof(magic));
return magic == SPIRV_MAGIC;
}
std::vector<u32> AdoptSpirvModule(std::span<const u8> blob) {
if (!IsSpirvModule(blob)) {
return {};
}
std::vector<u32> words(blob.size() / sizeof(u32));
std::memcpy(words.data(), blob.data(), blob.size());
RenumberBindingsInOrder(words);
return words;
}
} // namespace VideoCore::FrameGen
-17
View File
@@ -1,17 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <span>
#include <vector>
#include "common/common_types.h"
namespace VideoCore::FrameGen {
[[nodiscard]] bool IsSpirvModule(std::span<const u8> blob);
[[nodiscard]] std::vector<u32> AdoptSpirvModule(std::span<const u8> blob);
} // namespace VideoCore::FrameGen
@@ -1,361 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <algorithm>
#include <string>
#include <vector>
#include "common/fs/file.h"
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
#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"
namespace Vulkan {
namespace {
constexpr size_t COLOR_CHANNELS = 4;
constexpr u64 LSFG_REQUIRED_FRAMES = 2;
constexpr u32 LSFG_RECURRENCE_FRAMES = 2;
[[nodiscard]] f32 ManualFlowScale() {
return static_cast<f32>(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) {
return 1.0f;
}
const f32 rendered_width = static_cast<f32>(guest_extent.width) *
Settings::values.resolution_info.up_factor;
const f32 ratio = rendered_width / static_cast<f32>(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);
}
bool IsBlueFirst(VkFormat format) {
return format == VK_FORMAT_B8G8R8A8_UNORM || format == VK_FORMAT_B8G8R8A8_SRGB;
}
VkDeviceSize BytesPerTexel(VkFormat format) {
switch (format) {
case VK_FORMAT_R8_UNORM:
return 1;
case VK_FORMAT_R16G16B16A16_SFLOAT:
return 8;
default:
return COLOR_CHANNELS;
}
}
void WritePortablePixmap(const std::filesystem::path& path, const std::string& magic,
VkExtent2D extent, std::span<const u8> pixels) {
Common::FS::IOFile file{path, Common::FS::FileAccessMode::Write,
Common::FS::FileType::BinaryFile};
if (!file.IsOpen()) {
return;
}
const std::string header = magic + "\n" + std::to_string(extent.width) + " " +
std::to_string(extent.height) + "\n255\n";
if (file.Write(header) != header.size()) {
return;
}
void(file.Write(pixels));
void(file.Flush());
}
void WriteGrayscalePgm(const std::filesystem::path& path, VkExtent2D extent,
std::span<const u8> pixels) {
const size_t expected = static_cast<size_t>(extent.width) * extent.height;
WritePortablePixmap(path, "P5", extent, pixels.subspan(0, std::min(expected, pixels.size())));
}
void WriteRaw(const std::filesystem::path& path, std::span<const u8> pixels) {
Common::FS::IOFile file{path, Common::FS::FileAccessMode::Write,
Common::FS::FileType::BinaryFile};
if (!file.IsOpen()) {
return;
}
void(file.Write(pixels));
void(file.Flush());
}
void WriteColorPpm(const std::filesystem::path& path, VkExtent2D extent,
std::span<const u8> pixels, bool blue_first) {
const size_t pixel_count = static_cast<size_t>(extent.width) * extent.height;
if (pixels.size() < pixel_count * COLOR_CHANNELS) {
return;
}
std::vector<u8> rgb(pixel_count * 3);
for (size_t i = 0; i < pixel_count; ++i) {
const u8 first = pixels[i * COLOR_CHANNELS];
const u8 green = pixels[i * COLOR_CHANNELS + 1];
const u8 third = pixels[i * COLOR_CHANNELS + 2];
rgb[i * 3] = blue_first ? third : first;
rgb[i * 3 + 1] = green;
rgb[i * 3 + 2] = blue_first ? first : third;
}
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,
.pNext = nullptr,
.srcAccessMask = src_access,
.dstAccessMask = dst_access,
.oldLayout = old_layout,
.newLayout = new_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,
},
};
}
VkImageCopy MakeCopyRegion(VkExtent2D extent) {
return VkImageCopy{
.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},
};
}
void CopyPresentedFrame(vk::CommandBuffer cmdbuf, VkImage source, LsfgImage& destination,
VkExtent2D extent) {
const auto make_barrier = MakeTransitionBarrier;
const std::array before{
make_barrier(source, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_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,
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.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,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, VK_IMAGE_LAYOUT_GENERAL),
make_barrier(destination.Handle(), VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_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);
destination.SetLayout(VK_IMAGE_LAYOUT_GENERAL);
}
} // Anonymous namespace
FrameGen::FrameGen(MemoryAllocator& memory_allocator_, Scheduler& scheduler_)
: memory_allocator{memory_allocator_}, scheduler{scheduler_} {}
FrameGen::~FrameGen() = default;
void FrameGen::Process(const Device& device, Frame* frame, VkFormat format,
VkExtent2D guest_extent) {
generated = false;
if (unavailable || !Settings::values.frame_gen.GetValue()) {
if (chain) {
scheduler.Finish();
chain.reset();
}
warm_streak = 0;
return;
}
if (!frame->storage_view) {
unavailable = true;
return;
}
if (!shaders) {
shaders.emplace(device);
if (!shaders->IsValid()) {
unavailable = true;
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);
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);
}
const u64 count = frame_count++;
last_count = count;
last_generations = plan.generations;
const bool warm = plan.warm && count + 1 >= LSFG_REQUIRED_FRAMES;
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) {
chain->DispatchShared(cmdbuf, count);
}
});
const bool dump_requested = generated && Settings::values.frame_gen_dump_flow.GetValue();
if (!dump_requested) {
dumped = false;
} else if (!dumped) {
DumpDebugImages(count);
dumped = true;
}
}
size_t FrameGen::WantedGenerations(size_t capacity) {
if (unavailable) {
plan = {};
return 0;
}
plan = pacer.Plan(capacity);
return plan.generations;
}
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};
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);
});
}
void FrameGen::Rebuild(const Device& device, VkExtent2D extent, VkFormat format, f32 flow_scale) {
scheduler.Finish();
chain.reset();
built_flow_scale = flow_scale;
chain.emplace(device, memory_allocator, *shaders, extent, format, built_flow_scale);
built_extent = extent;
built_format = format;
frame_count = 0;
warm_streak = 0;
generated = false;
}
void FrameGen::DumpDebugImages(u64 count) {
const std::filesystem::path directory =
Common::FS::GetEdenPath(Common::FS::EdenPath::LosslessDir) / "debug";
if (!Common::FS::CreateDirs(directory)) {
return;
}
const auto dump = [&](const std::string& name, LsfgImage& image) {
const VkExtent2D extent = image.Extent();
const VkFormat format = image.Format();
const VkDeviceSize texel_size = BytesPerTexel(format);
const VkDeviceSize size =
static_cast<VkDeviceSize>(extent.width) * extent.height * texel_size;
vk::Buffer buffer = CreateWrappedBuffer(memory_allocator, size, MemoryUsage::Download);
scheduler.RequestOutsideRenderPassOperationContext();
scheduler.Record(
[handle = image.Handle(), dst = *buffer, extent](vk::CommandBuffer cmdbuf) {
DownloadColorImage(
cmdbuf, handle, dst,
VkExtent3D{.width = extent.width, .height = extent.height, .depth = 1});
});
scheduler.Finish();
buffer.Invalidate();
const std::span<u8> mapped = buffer.Mapped();
if (format == LSFG_FLOW_FORMAT) {
WriteGrayscalePgm(directory / (name + ".pgm"), extent, mapped);
} else if (texel_size == COLOR_CHANNELS) {
WriteColorPpm(directory / (name + ".ppm"), extent, mapped, IsBlueFirst(format));
} else {
WriteRaw(directory / (name + "_" + std::to_string(extent.width) + "x" +
std::to_string(extent.height) + ".f16"),
mapped.subspan(0, std::min<size_t>(size, mapped.size())));
}
};
dump("in0", chain->Input(0));
dump("in1", chain->Input(1));
for (size_t level = 0; level < LSFG_MIP_LEVELS; ++level) {
dump("flow_mip" + std::to_string(level), chain->FlowLevel(level));
}
for (size_t index = 0; index < 2; ++index) {
dump("alpha0_" + std::to_string(index), chain->AlphaOutput(0, count, index));
dump("alpha6_" + std::to_string(index), chain->AlphaOutput(LSFG_MIP_LEVELS - 1, count,
index));
}
for (size_t level = 0; level < LSFG_BETA_OUTPUTS; ++level) {
dump("beta_" + std::to_string(level), chain->BetaOutput(level));
}
dump("gamma0", chain->GammaOutput(0));
dump("gamma6", chain->GammaOutput(LSFG_MIP_LEVELS - 1));
dump("delta2_out1", chain->DeltaOutput1(LSFG_DELTA_INSTANCES - 1));
dump("delta2_out2", chain->DeltaOutput2(LSFG_DELTA_INSTANCES - 1));
}
} // namespace Vulkan
@@ -1,57 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <optional>
#include "common/common_types.h"
#include "video_core/renderer_vulkan/present/frame_gen_pacer.h"
#include "video_core/renderer_vulkan/present/lsfg_chain.h"
#include "video_core/renderer_vulkan/present/lsfg_shaders.h"
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
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);
[[nodiscard]] size_t WantedGenerations(size_t capacity);
[[nodiscard]] size_t GeneratedFrameCount() const;
void GenerateInto(const Device& device, Frame* destination, size_t generation);
private:
void Rebuild(const Device& device, VkExtent2D extent, VkFormat format, f32 flow_scale);
void DumpDebugImages(u64 count);
MemoryAllocator& memory_allocator;
Scheduler& scheduler;
std::optional<LsfgShaders> shaders;
std::optional<LsfgChain> chain;
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{};
size_t last_generations{};
u32 warm_streak{};
bool generated{};
bool unavailable{};
bool dumped{};
};
} // namespace Vulkan
@@ -1,240 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <algorithm>
#include <cmath>
#include <utility>
#include "common/settings.h"
#include "video_core/renderer_vulkan/present/frame_gen_pacer.h"
namespace Vulkan {
namespace {
using Clock = std::chrono::steady_clock;
constexpr f32 INTERVAL_SMOOTHING = 0.25f;
constexpr f32 MINIMUM_BASE_RATE = 10.0f;
constexpr f32 BURST_CADENCE_RATIO = 3.0f;
constexpr f32 BURST_TARGET_RATIO = 2.0f;
constexpr f32 PROBE_THROUGHPUT_TOLERANCE = 0.95f;
constexpr f32 PROBE_BASE_COLLAPSE_RATIO = 0.70f;
constexpr f32 PROBE_MARGINAL_GAIN = 1.15f;
constexpr f32 TARGET_SATISFIED_RATIO = 0.95f;
constexpr f32 UNLOADED_BASE_RETENTION = 0.75f;
constexpr f32 CREDIT_EPSILON = 1.0e-4f;
constexpr u32 MAX_PROBE_FAILURES = 4;
constexpr auto STABILIZATION_DURATION = std::chrono::seconds(1);
constexpr auto PROBE_DURATION = std::chrono::seconds(1);
constexpr auto DEFICIT_DURATION = std::chrono::seconds(1);
constexpr auto PROBE_STEP_DELAY = std::chrono::milliseconds(250);
[[nodiscard]] Clock::duration ProbeBackoff(u32 failures) {
switch (failures) {
case 1:
return std::chrono::seconds(5);
case 2:
return std::chrono::seconds(15);
case 3:
return std::chrono::seconds(30);
default:
return std::chrono::seconds(60);
}
}
} // Anonymous namespace
FrameGenPlan FrameGenPacer::Plan(size_t capacity) {
const size_t ceiling = std::min(capacity, Settings::FrameGenMaxGenerations());
if (ceiling == 0) {
Reset();
return {};
}
const Clock::time_point now = Clock::now();
const size_t previous_generations = std::exchange(issued_generations, 0);
if (!last_frame) {
last_frame = now;
return {};
}
const Clock::duration interval = now - *last_frame;
const f32 interval_seconds = std::chrono::duration<f32>(interval).count();
last_frame = now;
if (interval_seconds <= 0.0f) {
Stabilize(now);
return {};
}
const f32 target_rate = static_cast<f32>(Settings::values.frame_gen_target_rate.GetValue());
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);
}
if (1.0f / interval_seconds > burst_threshold) {
DeferEvaluations(interval);
output_credit = 0.0f;
return {};
}
}
if (interval_seconds > 1.0f / MINIMUM_BASE_RATE) {
Stabilize(now);
return {};
}
smoothed_interval = smoothed_interval > 0.0f
? smoothed_interval +
(interval_seconds - smoothed_interval) * INTERVAL_SMOOTHING
: interval_seconds;
if (previous_generations == 0) {
const f32 measured = 1.0f / smoothed_interval;
unloaded_base_rate =
unloaded_base_rate > 0.0f
? unloaded_base_rate + (measured - unloaded_base_rate) * INTERVAL_SMOOTHING
: measured;
}
if (stable_until) {
if (now < *stable_until) {
return {};
}
stable_until.reset();
}
if (target_rate == 0.0f) {
limit = std::min(Settings::FrameGenGenerations(), ceiling);
output_credit = 0.0f;
issued_generations = limit;
return {.generations = limit, .warm = limit > 0};
}
UpdateLimit(now, 1.0f / smoothed_interval, target_rate, 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;
return {};
}
output_credit += desired_outputs;
const size_t outputs =
std::max<size_t>(1, static_cast<size_t>(std::floor(output_credit + CREDIT_EPSILON)));
const size_t generations = std::min(outputs - 1, allowed);
output_credit -= static_cast<f32>(generations + 1);
if (output_credit < 0.0f) {
output_credit = 0.0f;
} else if (generations == allowed && output_credit >= 1.0f) {
output_credit = std::fmod(output_credit, 1.0f);
}
issued_generations = generations;
return {.generations = generations, .warm = true};
}
void FrameGenPacer::UpdateLimit(Clock::time_point now, f32 base_rate, f32 target_rate,
size_t ceiling) {
limit = std::min(limit, ceiling);
if (probe_until) {
if (now < *probe_until) {
return;
}
probe_until.reset();
output_credit = 0.0f;
const f32 previous_output =
std::min(target_rate, probe_base_rate * static_cast<f32>(probe_previous_limit + 1));
const f32 current_output =
std::min(target_rate, base_rate * static_cast<f32>(limit + 1));
const bool throughput_regressed =
current_output < previous_output * PROBE_THROUGHPUT_TOLERANCE;
const bool collapsed_for_marginal_gain =
base_rate < probe_base_rate * PROBE_BASE_COLLAPSE_RATIO &&
current_output < previous_output * PROBE_MARGINAL_GAIN;
const bool emulation_slowed = unloaded_base_rate > 0.0f &&
base_rate < unloaded_base_rate * UNLOADED_BASE_RETENTION;
if (throughput_regressed || collapsed_for_marginal_gain || emulation_slowed) {
limit = probe_previous_limit;
probe_failures = std::min(probe_failures + 1, MAX_PROBE_FAILURES);
next_probe = now + ProbeBackoff(probe_failures);
deficit_since.reset();
return;
}
probe_failures = 0;
next_probe = now + PROBE_STEP_DELAY;
}
if (base_rate * static_cast<f32>(limit + 1) >= target_rate * TARGET_SATISFIED_RATIO ||
limit >= ceiling) {
deficit_since.reset();
return;
}
if (!deficit_since) {
deficit_since = now;
return;
}
if (now - *deficit_since < DEFICIT_DURATION) {
return;
}
if (next_probe && now < *next_probe) {
return;
}
probe_previous_limit = limit;
probe_base_rate = base_rate;
++limit;
probe_until = now + PROBE_DURATION;
deficit_since.reset();
output_credit = 0.0f;
}
void FrameGenPacer::DeferEvaluations(Clock::duration amount) {
const auto defer = [amount](std::optional<Clock::time_point>& deadline) {
if (deadline) {
*deadline += amount;
}
};
defer(stable_until);
defer(probe_until);
defer(next_probe);
deficit_since.reset();
}
void FrameGenPacer::Stabilize(Clock::time_point now) {
stable_until = now + STABILIZATION_DURATION;
probe_until.reset();
deficit_since.reset();
smoothed_interval = 0.0f;
output_credit = 0.0f;
}
void FrameGenPacer::Reset() {
last_frame.reset();
stable_until.reset();
probe_until.reset();
next_probe.reset();
deficit_since.reset();
smoothed_interval = 0.0f;
output_credit = 0.0f;
probe_base_rate = 0.0f;
unloaded_base_rate = 0.0f;
issued_generations = 0;
probe_previous_limit = 0;
limit = 0;
probe_failures = 0;
}
} // namespace Vulkan
@@ -1,46 +0,0 @@
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <chrono>
#include <optional>
#include "common/common_types.h"
namespace Vulkan {
struct FrameGenPlan {
size_t generations{};
bool warm{};
};
class FrameGenPacer {
public:
[[nodiscard]] FrameGenPlan Plan(size_t capacity);
void Reset();
private:
using Clock = std::chrono::steady_clock;
void Stabilize(Clock::time_point now);
void DeferEvaluations(Clock::duration amount);
void UpdateLimit(Clock::time_point now, f32 base_rate, f32 target_rate, size_t ceiling);
std::optional<Clock::time_point> last_frame;
std::optional<Clock::time_point> stable_until;
std::optional<Clock::time_point> probe_until;
std::optional<Clock::time_point> next_probe;
std::optional<Clock::time_point> deficit_since;
f32 smoothed_interval{};
f32 output_credit{};
f32 probe_base_rate{};
f32 unloaded_base_rate{};
size_t issued_generations{};
size_t probe_previous_limit{};
size_t limit{};
u32 probe_failures{};
};
} // namespace Vulkan

Some files were not shown because too many files have changed in this diff Show More