mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-30 15:39:02 -05:00 
			
		
		
		
	Implemented GetDefaultDisplayResolution
This commit is contained in:
		| @@ -20,6 +20,7 @@ | ||||
| #include "core/hle/service/nvflinger/nvflinger.h" | ||||
| #include "core/hle/service/pm/pm.h" | ||||
| #include "core/hle/service/set/set.h" | ||||
| #include "core/hle/service/vi/vi.h" | ||||
| #include "core/settings.h" | ||||
|  | ||||
| namespace Service::AM { | ||||
| @@ -334,7 +335,7 @@ ICommonStateGetter::ICommonStateGetter() : ServiceFramework("ICommonStateGetter" | ||||
|         {51, nullptr, "SetVrModeEnabled"}, | ||||
|         {52, nullptr, "SwitchLcdBacklight"}, | ||||
|         {55, nullptr, "IsInControllerFirmwareUpdateSection"}, | ||||
|         {60, nullptr, "GetDefaultDisplayResolution"}, | ||||
|         {60, &ICommonStateGetter::GetDefaultDisplayResolution, "GetDefaultDisplayResolution"}, | ||||
|         {61, &ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent, | ||||
|          "GetDefaultDisplayResolutionChangeEvent"}, | ||||
|         {62, nullptr, "GetHdcpAuthenticationState"}, | ||||
| @@ -393,6 +394,21 @@ void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLEReque | ||||
|     LOG_WARNING(Service_AM, "(STUBBED) called"); | ||||
| } | ||||
|  | ||||
| void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx) { | ||||
|     IPC::ResponseBuilder rb{ctx, 4}; | ||||
|     rb.Push(RESULT_SUCCESS); | ||||
|  | ||||
|     if (Settings::values.use_docked_mode) { | ||||
|         rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth)); | ||||
|         rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight)); | ||||
|     } else { | ||||
|         rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth)); | ||||
|         rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight)); | ||||
|     } | ||||
|  | ||||
|     LOG_DEBUG(Service_AM, "called"); | ||||
| } | ||||
|  | ||||
| void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) { | ||||
|     const bool use_docked_mode{Settings::values.use_docked_mode}; | ||||
|     IPC::ResponseBuilder rb{ctx, 3}; | ||||
|   | ||||
| @@ -123,6 +123,7 @@ private: | ||||
|     void GetOperationMode(Kernel::HLERequestContext& ctx); | ||||
|     void GetPerformanceMode(Kernel::HLERequestContext& ctx); | ||||
|     void GetBootMode(Kernel::HLERequestContext& ctx); | ||||
|     void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); | ||||
|  | ||||
|     Kernel::SharedPtr<Kernel::Event> event; | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David Marcec
					David Marcec