diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp index 4487fa5cfd..505d2ce6da 100644 --- a/src/core/hle/kernel/svc/svc_info.cpp +++ b/src/core/hle/kernel/svc/svc_info.cpp @@ -10,17 +10,15 @@ #include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_resource_limit.h" #include "core/hle/kernel/svc.h" +#include "core/hle/kernel/svc_results.h" +#include "core/hle/kernel/svc_version.h" namespace Kernel::Svc { /// Gets system/memory information for the current process -Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle handle, - u64 info_sub_id) { - LOG_TRACE(Kernel_SVC, "called info_id={:#x}, info_sub_id={:#x}, handle={:#08x}", - info_id_type, info_sub_id, handle); - - u32 info_id = static_cast(info_id_type); - +Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle handle, u64 info_sub_id) { + LOG_TRACE(Kernel_SVC, "called info_id={:#x}, info_sub_id={:#x}, handle={:#08x}", info_id_type, info_sub_id, handle); + u32 info_id = u32(info_id_type); switch (info_id_type) { case InfoType::CoreMask: case InfoType::PriorityMask: @@ -53,152 +51,127 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle case InfoType::CoreMask: *result = process->GetCoreMask(); R_SUCCEED(); - case InfoType::PriorityMask: *result = process->GetPriorityMask(); R_SUCCEED(); - case InfoType::AliasRegionAddress: *result = GetInteger(process->GetPageTable().GetAliasRegionStart()); R_SUCCEED(); - case InfoType::AliasRegionSize: *result = process->GetPageTable().GetAliasRegionSize(); R_SUCCEED(); case InfoType::HeapRegionAddress: *result = GetInteger(process->GetPageTable().GetHeapRegionStart()); R_SUCCEED(); - case InfoType::HeapRegionSize: *result = process->GetPageTable().GetHeapRegionSize(); R_SUCCEED(); - case InfoType::AslrRegionAddress: *result = GetInteger(process->GetPageTable().GetAliasCodeRegionStart()); R_SUCCEED(); - case InfoType::AslrRegionSize: *result = process->GetPageTable().GetAliasCodeRegionSize(); R_SUCCEED(); - case InfoType::StackRegionAddress: *result = GetInteger(process->GetPageTable().GetStackRegionStart()); R_SUCCEED(); - case InfoType::StackRegionSize: *result = process->GetPageTable().GetStackRegionSize(); R_SUCCEED(); - case InfoType::TotalMemorySize: *result = process->GetTotalUserPhysicalMemorySize(system.Kernel()); R_SUCCEED(); - case InfoType::UsedMemorySize: *result = process->GetUsedUserPhysicalMemorySize(system.Kernel()); R_SUCCEED(); - case InfoType::SystemResourceSizeTotal: *result = process->GetTotalSystemResourceSize(); R_SUCCEED(); - case InfoType::SystemResourceSizeUsed: *result = process->GetUsedSystemResourceSize(); R_SUCCEED(); - case InfoType::ProgramId: *result = process->GetProgramId(); R_SUCCEED(); - case InfoType::UserExceptionContextAddress: *result = GetInteger(process->GetProcessLocalRegionAddress()); R_SUCCEED(); - case InfoType::TotalNonSystemMemorySize: *result = process->GetTotalNonSystemUserPhysicalMemorySize(system.Kernel()); R_SUCCEED(); - case InfoType::UsedNonSystemMemorySize: *result = process->GetUsedNonSystemUserPhysicalMemorySize(system.Kernel()); R_SUCCEED(); - case InfoType::IsApplication: *result = process->IsApplication(); R_SUCCEED(); - case InfoType::FreeThreadCount: if (KResourceLimit* resource_limit = process->GetResourceLimit(); resource_limit != nullptr) { - const auto current_value = - resource_limit->GetCurrentValue(Svc::LimitableResource::ThreadCountMax); - const auto limit_value = - resource_limit->GetLimitValue(Svc::LimitableResource::ThreadCountMax); + const auto current_value = resource_limit->GetCurrentValue(Svc::LimitableResource::ThreadCountMax); + const auto limit_value = resource_limit->GetLimitValue(Svc::LimitableResource::ThreadCountMax); *result = limit_value - current_value; } else { *result = 0; } R_SUCCEED(); - case InfoType::AliasRegionExtraSize: { - if (info_sub_id != 0) { - return ResultInvalidCombination; - } - + R_UNLESS(info_sub_id == 0, ResultInvalidCombination); KProcess* current_process = GetCurrentProcessPointer(system.Kernel()); *result = current_process->GetPageTable().GetAliasRegionExtraSize(); - R_SUCCEED(); } - default: break; } - LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id={:#016x}", info_id); R_THROW(ResultInvalidEnumValue); } - case InfoType::DebuggerAttached: *result = 0; R_SUCCEED(); - case InfoType::ResourceLimit: { R_UNLESS(handle == 0, ResultInvalidHandle); R_UNLESS(info_sub_id == 0, ResultInvalidCombination); - KProcess* const current_process = GetCurrentProcessPointer(system.Kernel()); KHandleTable& handle_table = current_process->GetHandleTable(); - const auto resource_limit = current_process->GetResourceLimit(); - if (!resource_limit) { + if (auto const resource_limit = current_process->GetResourceLimit(); resource_limit) { + Handle resource_handle{}; + R_TRY(handle_table.Add(system.Kernel(), std::addressof(resource_handle), resource_limit)); + *result = resource_handle; + } else { *result = Svc::InvalidHandle; - // Yes, the kernel considers this a successful operation. - R_SUCCEED(); } - - Handle resource_handle{}; - R_TRY(handle_table.Add(system.Kernel(), std::addressof(resource_handle), resource_limit)); - - *result = resource_handle; + // Yes, the kernel considers this a successful operation either way. R_SUCCEED(); } - case InfoType::RandomEntropy: R_UNLESS(handle == 0, ResultInvalidHandle); R_UNLESS(info_sub_id < 4, ResultInvalidCombination); - *result = GetCurrentProcess(system.Kernel()).GetRandomEntropy(info_sub_id); R_SUCCEED(); - - case InfoType::InitialProcessIdRange: - LOG_WARNING(Kernel_SVC, - "(STUBBED) Attempted to query privileged process id bounds, returned 0"); - *result = 0; - R_SUCCEED(); - + case InfoType::InitialProcessIdRange: { + enum InitialProcessIdRangeInfo : u64 { + Minimum = 0, + Maximum = 1, + }; + LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query privileged process id bounds, returned 0/64"); + R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); + switch (InitialProcessIdRangeInfo(info_sub_id)) { + case InitialProcessIdRangeInfo::Minimum: + *result = 0; //todo + R_SUCCEED(); + case InitialProcessIdRangeInfo::Maximum: + *result = 64; //todo + R_SUCCEED(); + default: + R_THROW(ResultInvalidCombination); + } + } case InfoType::ThreadTickCount: { constexpr u64 num_cpus = 4; if (info_sub_id != 0xFFFFFFFFFFFFFFFF && info_sub_id >= num_cpus) { - LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus, - info_sub_id); + LOG_ERROR(Kernel_SVC, "Core count is out of range, expected {} but got {}", num_cpus, info_sub_id); R_THROW(ResultInvalidCombination); } @@ -206,8 +179,7 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle .GetHandleTable() .GetObject(system.Kernel(), Handle(handle)); if (thread.IsNull()) { - LOG_ERROR(Kernel_SVC, "Thread handle does not exist, handle={:#08x}", - static_cast(handle)); + LOG_ERROR(Kernel_SVC, "Thread handle does not exist, handle={:#08x}", Handle(handle)); R_THROW(ResultInvalidHandle); } @@ -220,7 +192,6 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle u64 out_ticks = 0; if (same_thread && info_sub_id == 0xFFFFFFFFFFFFFFFF) { const u64 thread_ticks = current_thread->GetCpuTime(); - out_ticks = thread_ticks + (core_timing.GetClockTicks() - prev_ctx_ticks); } else if (same_thread && info_sub_id == system.Kernel().CurrentPhysicalCoreIndex()) { out_ticks = core_timing.GetClockTicks() - prev_ctx_ticks; @@ -230,19 +201,40 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle R_SUCCEED(); } case InfoType::IdleTickCount: { - // Verify the input handle is invalid. - R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); - // Verify the requested core is valid. const bool core_valid = - (info_sub_id == 0xFFFFFFFFFFFFFFFF) || - (info_sub_id == static_cast(system.Kernel().CurrentPhysicalCoreIndex())); + (info_sub_id == 0xFFFFFFFFFFFFFFFF) + || (info_sub_id == u64(system.Kernel().CurrentPhysicalCoreIndex())); R_UNLESS(core_valid, ResultInvalidCombination); + // Verify the input handle is invalid. + R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); + // Get the idle tick count. *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); R_SUCCEED(); } + case InfoType::MesosphereMeta: { + enum MesosphereMetaInfo : u64 { + KernelVersion = 0, + IsKTraceEnabled = 1, + IsSingleStepEnabled = 2, + }; + R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); + switch (MesosphereMetaInfo(info_sub_id)) { + case MesosphereMetaInfo::KernelVersion: + *result = Kernel::Svc::SupportedKernelVersion; + R_SUCCEED(); + case MesosphereMetaInfo::IsKTraceEnabled: + *result = 0; + R_SUCCEED(); + case MesosphereMetaInfo::IsSingleStepEnabled: + *result = 0; + R_SUCCEED(); + default: + R_THROW(ResultInvalidCombination); + } + } case InfoType::MesosphereCurrentProcess: { // Verify the input handle is invalid. R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); @@ -255,13 +247,11 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle KHandleTable& handle_table = current_process->GetHandleTable(); // Get a new handle for the current process. - Handle tmp; + Handle tmp{}; R_TRY(handle_table.Add(system.Kernel(), std::addressof(tmp), current_process)); // Set the output. *result = tmp; - - // We succeeded. R_SUCCEED(); } default: diff --git a/src/core/hle/service/am/am_types.h b/src/core/hle/service/am/am_types.h index f88f91ae47..6b7cbbc12a 100644 --- a/src/core/hle/service/am/am_types.h +++ b/src/core/hle/service/am/am_types.h @@ -154,6 +154,7 @@ enum class AppletMessage : u32 { DetectLongPressingCaptureButton = 91, AlbumScreenShotTaken = 92, AlbumRecordingSaved = 93, + StartupLogoDisappeared = 95, }; enum class LibraryAppletMode : u32 { diff --git a/src/core/hle/service/am/applet.h b/src/core/hle/service/am/applet.h index 73303b2e66..571fa65219 100644 --- a/src/core/hle/service/am/applet.h +++ b/src/core/hle/service/am/applet.h @@ -91,6 +91,7 @@ struct Applet { // Common state bool sleep_lock_enabled{}; bool vr_mode_enabled{}; + bool vr_mode_enabled_3d{}; bool lcd_backlight_off_enabled{}; APM::CpuBoostMode boost_mode{}; bool request_exit_to_library_applet_at_execute_next_program_enabled{}; diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp index 562d95f001..437032c2f4 100644 --- a/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp +++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.cpp @@ -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 @@ -73,8 +73,7 @@ Result IAllSystemAppletProxiesService::OpenLibraryAppletProxy( Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy( Out> out_overlay_applet_proxy, ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute) { + InCopyHandle process_handle) { LOG_WARNING(Service_AM, "called"); if (const auto applet = this->GetAppletFromProcessId(pid); applet) { @@ -89,8 +88,7 @@ Result IAllSystemAppletProxiesService::OpenOverlayAppletProxy( Result IAllSystemAppletProxiesService::OpenSystemApplicationProxy( Out> out_system_application_proxy, ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute) { + InCopyHandle process_handle) { LOG_DEBUG(Service_AM, "called"); if (const auto applet = this->GetAppletFromProcessId(pid); applet) { diff --git a/src/core/hle/service/am/service/all_system_applet_proxies_service.h b/src/core/hle/service/am/service/all_system_applet_proxies_service.h index eccd92a376..73cb8a09ac 100644 --- a/src/core/hle/service/am/service/all_system_applet_proxies_service.h +++ b/src/core/hle/service/am/service/all_system_applet_proxies_service.h @@ -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 @@ -36,15 +36,13 @@ private: InCopyHandle process_handle, InLargeData attribute); Result OpenOverlayAppletProxy(Out> out_overlay_applet_proxy, - ClientProcessId pid, InCopyHandle process_handle, - InLargeData attribute); + ClientProcessId pid, InCopyHandle process_handle); Result OpenLibraryAppletProxyOld( Out> out_library_applet_proxy, ClientProcessId pid, InCopyHandle process_handle); Result OpenSystemApplicationProxy( Out> out_system_application_proxy, ClientProcessId pid, - InCopyHandle process_handle, - InLargeData attribute); + InCopyHandle process_handle); Result GetSystemProcessCommonFunctions(); Result GetAppletAlternativeFunctions(); diff --git a/src/core/hle/service/am/service/common_state_getter.cpp b/src/core/hle/service/am/service/common_state_getter.cpp index 23f67dcf17..a64b9d4328 100644 --- a/src/core/hle/service/am/service/common_state_getter.cpp +++ b/src/core/hle/service/am/service/common_state_getter.cpp @@ -39,7 +39,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr, "PushToGeneralChannel"}, - {30, nullptr, "GetHomeButtonReaderLockAccessor"}, + {30, D<&ICommonStateGetter::GetHomeButtonReaderLockAccessor>, "GetHomeButtonReaderLockAccessor"}, {31, D<&ICommonStateGetter::GetReaderLockAccessorEx>, "GetReaderLockAccessorEx"}, //2.0.0+ {32, D<&ICommonStateGetter::GetWriterLockAccessorEx>, "GetWriterLockAccessorEx"}, //7.0.0+ {40, nullptr, "GetCradleFwVersion"}, //2.0.0+ @@ -65,7 +65,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr, "SetHandlingHomeButtonShortPressedEnabled"}, {110, nullptr, "OpenMyGpuErrorHandler"}, {120, D<&ICommonStateGetter::GetAppletLaunchedHistory>, "GetAppletLaunchedHistory"}, //13.0.0+ - {130, nullptr, "Unknown130"}, //21.0.0+ + {130, D<&ICommonStateGetter::EnableStartupLogoDisappearedMessage>, "EnableStartupLogoDisappearedMessage"}, //21.0.0+ {200, D<&ICommonStateGetter::GetOperationModeSystemInfo>, "GetOperationModeSystemInfo"}, {300, D<&ICommonStateGetter::GetSettingsPlatformRegion>, "GetSettingsPlatformRegion"}, {400, nullptr, "ActivateMigrationService"}, @@ -74,14 +74,17 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr, "Unknown610"}, //21.0.0+ {611, D<&ICommonStateGetter::Unknown611>, "Unknown611"}, //22.0.0+ {900, D<&ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled>, "SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled"}, //11.0.0+ {910, nullptr, "GetLaunchRequiredTick"}, //17.0.0+ - {1000, nullptr, "BeginVrMode3d"}, //19.0.0+ - {1001, nullptr, "EndVrMode3d"}, //19.0.0+ - {1002, nullptr, "IsVrModeEnabled3d"}, //19.0.0+ + {1000, D<&ICommonStateGetter::BeginVrMode3d>, "BeginVrMode3d"}, //19.0.0+ + {1001, D<&ICommonStateGetter::EndVrMode3d>, "EndVrMode3d"}, //19.0.0+ + {1002, D<&ICommonStateGetter::IsVrModeEnabled3d>, "IsVrModeEnabled3d"}, //19.0.0+ + {1003, D<&ICommonStateGetter::GetVrLaboGoggleViewport>, "GetVrLaboGoggleViewport"}, //21.0.0+ + {1004, D<&ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle>, "GetPanelPhysicalSizeForSpecificTitle"}, //21.0.0+ + {1005, D<&ICommonStateGetter::GetPanelResolutionForSpecificTitle>, "GetPanelResolutionForSpecificTitle"}, //21.0.0+ }; // clang-format on @@ -311,6 +314,12 @@ Result ICommonStateGetter::PerformSystemButtonPressingIfInFocus(SystemButtonType R_SUCCEED(); } +Result ICommonStateGetter::EnableStartupLogoDisappearedMessage() { + LOG_WARNING(Service_AM, "(STUBBED) called"); + m_applet->lifecycle_manager.PushUnorderedMessage(system.Kernel(), AppletMessage::StartupLogoDisappeared); + R_SUCCEED(); +} + Result ICommonStateGetter::GetOperationModeSystemInfo(Out out_operation_mode_system_info) { LOG_WARNING(Service_AM, "(STUBBED) called"); *out_operation_mode_system_info = 0; @@ -355,6 +364,12 @@ Result ICommonStateGetter::PushToGeneralChannel(SharedPointer storage) R_SUCCEED(); } +Result ICommonStateGetter::GetHomeButtonReaderLockAccessor(Out> out_lock_accessor) { + LOG_DEBUG(Service_AM, "called"); + *out_lock_accessor = std::make_shared(system); + R_SUCCEED(); +} + Result ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled(bool enabled) { LOG_DEBUG(Service_AM, "called, enabled={} applet_id={}", enabled, m_applet->applet_id); @@ -363,14 +378,58 @@ Result ICommonStateGetter::SetHandlingHomeButtonShortPressedEnabled(bool enabled R_SUCCEED(); } -Result ICommonStateGetter::Unknown610() { +Result ICommonStateGetter::Unknown610(u64 unk) { LOG_WARNING(Service_AM, "(STUBBED) called"); R_SUCCEED(); } -Result ICommonStateGetter::Unknown611() { +Result ICommonStateGetter::Unknown611(u8 unk) { LOG_WARNING(Service_AM, "(STUBBED) called"); R_SUCCEED(); } +Result ICommonStateGetter::BeginVrMode3d() { + std::scoped_lock lk{m_applet->lock}; + m_applet->vr_mode_enabled = true; + LOG_WARNING(Service_AM, "VR Mode is {}", m_applet->vr_mode_enabled_3d ? "on" : "off"); + R_SUCCEED(); +} + +Result ICommonStateGetter::EndVrMode3d() { + std::scoped_lock lk{m_applet->lock}; + m_applet->vr_mode_enabled_3d = false; + LOG_WARNING(Service_AM, "VR Mode is {}", m_applet->vr_mode_enabled_3d ? "on" : "off"); + R_SUCCEED(); +} + +Result ICommonStateGetter::IsVrModeEnabled3d(Out out_is_vr_mode_enabled_3d) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + std::scoped_lock lk{m_applet->lock}; + *out_is_vr_mode_enabled_3d = m_applet->vr_mode_enabled_3d; + R_SUCCEED(); +} + +Result ICommonStateGetter::GetVrLaboGoggleViewport(Out out_x, Out out_y, Out out_width, Out out_height) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_x = 0; + *out_y = 0; + *out_width = 1280; + *out_height = 720; + R_SUCCEED(); +} + +Result ICommonStateGetter::GetPanelPhysicalSizeForSpecificTitle(Out out_width, Out out_height) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_width = 137250.0f / 1000.0f; + *out_height = 77200.0f / 1000.0f; + R_SUCCEED(); +} + +Result ICommonStateGetter::GetPanelResolutionForSpecificTitle(Out out_width, Out out_height) { + LOG_WARNING(Service_AM, "(STUBBED) called"); + *out_width = 1280; + *out_height = 720; + R_SUCCEED(); +} + } // namespace Service::AM diff --git a/src/core/hle/service/am/service/common_state_getter.h b/src/core/hle/service/am/service/common_state_getter.h index c1bec4f2a2..da86b5d079 100644 --- a/src/core/hle/service/am/service/common_state_getter.h +++ b/src/core/hle/service/am/service/common_state_getter.h @@ -56,15 +56,23 @@ private: Result GetDefaultDisplayResolution(Out out_width, Out out_height); Result GetBuiltInDisplayType(Out out_display_type); Result PerformSystemButtonPressingIfInFocus(SystemButtonType type); + Result EnableStartupLogoDisappearedMessage(); Result GetOperationModeSystemInfo(Out out_operation_mode_system_info); Result GetAppletLaunchedHistory(Out out_count, OutArray out_applet_ids); Result GetSettingsPlatformRegion(Out out_settings_platform_region); Result SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(); Result PushToGeneralChannel(SharedPointer storage); // cmd 20 + Result GetHomeButtonReaderLockAccessor(Out> out_lock_accessor); Result SetHandlingHomeButtonShortPressedEnabled(bool enabled); - Result Unknown610(); - Result Unknown611(); + Result Unknown610(u64 unk); + Result Unknown611(u8 unk); + Result BeginVrMode3d(); + Result EndVrMode3d(); + Result IsVrModeEnabled3d(Out out_is_vr_mode_enabled_3d); + Result GetVrLaboGoggleViewport(Out out_x, Out out_y, Out out_width, Out out_height); + Result GetPanelPhysicalSizeForSpecificTitle(Out out_width, Out out_height); + Result GetPanelResolutionForSpecificTitle(Out out_width, Out out_height); void SetCpuBoostMode(HLERequestContext& ctx); diff --git a/src/core/hle/service/i2c/i2c.cpp b/src/core/hle/service/i2c/i2c.cpp index d000487246..01e348cc24 100644 --- a/src/core/hle/service/i2c/i2c.cpp +++ b/src/core/hle/service/i2c/i2c.cpp @@ -32,7 +32,6 @@ public: RegisterHandlers(functions); } ~I2CSession() override = default; - Result Send(InBuffer in_data, u32 transaction_option) { LOG_WARNING(Service, "(stubbed) topt={}", transaction_option); R_THROW(ResultUnknown); @@ -50,21 +49,40 @@ public: : ServiceFramework{system_, "i2c"} { static const FunctionInfo functions[] = { - {0, nullptr, "OpenSessionForDev"}, + {0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"}, {1, C<&I2C::OpenSession>, "OpenSession"}, - {2, nullptr, "HasDevice"}, - {3, nullptr, "HasDeviceForDev"}, - {4, nullptr, "OpenSession2"}, + {2, C<&I2C::HasDevice>, "HasDevice"}, + {3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"}, + {4, C<&I2C::OpenSession2>, "OpenSession2"}, }; RegisterHandlers(functions); } ~I2C() override = default; - - Result OpenSession(I2CDevice device, OutInterface out_session) { + Result OpenSessionForDev(OutInterface out_session, s32 bus_idx, u16 slave_address, u32 addressing_mode, u32 speed_mode) { LOG_DEBUG(Service, "(stubbed)"); *out_session = std::make_shared(system); R_SUCCEED(); } + Result OpenSession(OutInterface out_session, I2CDevice device) { + LOG_DEBUG(Service, "(stubbed)"); + *out_session = std::make_shared(system); + R_SUCCEED(); + } + Result HasDevice(Out out_has_device, I2CDevice device) { + LOG_DEBUG(Service, "(stubbed)"); + *out_has_device = false; + R_SUCCEED(); + } + Result HasDeviceForDev(Out out_has_device, I2CDevice device) { + LOG_DEBUG(Service, "(stubbed)"); + *out_has_device = false; + R_SUCCEED(); + } + Result OpenSession2(OutInterface out_session, u32 device_code) { + LOG_DEBUG(Service, "(stubbed) device_code={}", device_code); + *out_session = std::make_shared(system); + R_SUCCEED(); + } }; void LoopProcess(Core::System& system) { diff --git a/src/core/hle/service/vi/application_display_service.cpp b/src/core/hle/service/vi/application_display_service.cpp index d842c9dd42..f179ba676a 100644 --- a/src/core/hle/service/vi/application_display_service.cpp +++ b/src/core/hle/service/vi/application_display_service.cpp @@ -13,6 +13,7 @@ #include "core/hle/service/vi/manager_display_service.h" #include "core/hle/service/vi/system_display_service.h" #include "core/hle/service/vi/vi_results.h" +#include "service_creator.h" namespace Service::VI { @@ -38,6 +39,7 @@ IApplicationDisplayService::IApplicationDisplayService(Core::System& system_, {2031, C<&IApplicationDisplayService::DestroyStrayLayer>, "DestroyStrayLayer"}, {2101, C<&IApplicationDisplayService::SetLayerScalingMode>, "SetLayerScalingMode"}, {2102, C<&IApplicationDisplayService::ConvertScalingMode>, "ConvertScalingMode"}, + {2103, C<&IApplicationDisplayService::Cmd2103>, "Cmd2103"}, {2450, C<&IApplicationDisplayService::GetIndirectLayerImageMap>, "GetIndirectLayerImageMap"}, {2451, nullptr, "GetIndirectLayerImageCropMap"}, {2460, C<&IApplicationDisplayService::GetIndirectLayerImageRequiredMemoryInfo>, "GetIndirectLayerImageRequiredMemoryInfo"}, @@ -289,6 +291,11 @@ Result IApplicationDisplayService::ConvertScalingMode(Out ou } } +Result IApplicationDisplayService::Cmd2103(Out> out_unk18) { + LOG_WARNING(Service_VI, "(stubbed)"); + R_SUCCEED(); +} + Result IApplicationDisplayService::GetIndirectLayerImageMap( Out out_size, Out out_stride, OutBuffer out_buffer, diff --git a/src/core/hle/service/vi/application_display_service.h b/src/core/hle/service/vi/application_display_service.h index a2eeb4c70c..d2db391efd 100644 --- a/src/core/hle/service/vi/application_display_service.h +++ b/src/core/hle/service/vi/application_display_service.h @@ -64,6 +64,7 @@ public: Result GetDisplayVsyncEvent(OutCopyHandle out_vsync_event, u64 display_id); Result ConvertScalingMode(Out out_scaling_mode, NintendoScaleMode mode); + Result Cmd2103(Out> out_unk18); Result GetIndirectLayerImageMap( Out out_size, Out out_stride, OutBuffer out_buffer,