diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/hle/service/vi/system_display_service.cpp | 39 | ||||
-rw-r--r-- | src/core/hle/service/vi/system_display_service.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/vi/vi_types.h | 8 |
3 files changed, 41 insertions, 12 deletions
diff --git a/src/core/hle/service/vi/system_display_service.cpp b/src/core/hle/service/vi/system_display_service.cpp index 9e28fdda3..c3c50b07b 100644 --- a/src/core/hle/service/vi/system_display_service.cpp +++ b/src/core/hle/service/vi/system_display_service.cpp @@ -29,7 +29,7 @@ ISystemDisplayService::ISystemDisplayService(Core::System& system_, {2400, nullptr, "OpenIndirectLayer"}, {2401, nullptr, "CloseIndirectLayer"}, {2402, nullptr, "FlipIndirectLayer"}, - {3000, nullptr, "ListDisplayModes"}, + {3000, C<&ISystemDisplayService::ListDisplayModes>, "ListDisplayModes"}, {3001, nullptr, "ListDisplayRgbRanges"}, {3002, nullptr, "ListDisplayContentTypes"}, {3200, C<&ISystemDisplayService::GetDisplayMode>, "GetDisplayMode"}, @@ -80,20 +80,39 @@ Result ISystemDisplayService::SetLayerVisibility(bool visible, u64 layer_id) { R_SUCCEED(); } -Result ISystemDisplayService::GetDisplayMode(Out<u32> out_width, Out<u32> out_height, - Out<f32> out_refresh_rate, Out<u32> out_unknown) { - LOG_WARNING(Service_VI, "(STUBBED) called"); +Result ISystemDisplayService::ListDisplayModes( + Out<u64> out_count, u64 display_id, + OutArray<DisplayMode, BufferAttr_HipcMapAlias> out_display_modes) { + LOG_WARNING(Service_VI, "(STUBBED) called, display_id={}", display_id); + + if (!out_display_modes.empty()) { + out_display_modes[0] = { + .width = 1920, + .height = 1080, + .refresh_rate = 60.f, + .unknown = {}, + }; + *out_count = 1; + } else { + *out_count = 0; + } + + R_SUCCEED(); +} + +Result ISystemDisplayService::GetDisplayMode(Out<DisplayMode> out_display_mode, u64 display_id) { + LOG_WARNING(Service_VI, "(STUBBED) called, display_id={}", display_id); if (Settings::IsDockedMode()) { - *out_width = static_cast<u32>(DisplayResolution::DockedWidth); - *out_height = static_cast<u32>(DisplayResolution::DockedHeight); + out_display_mode->width = static_cast<u32>(DisplayResolution::DockedWidth); + out_display_mode->height = static_cast<u32>(DisplayResolution::DockedHeight); } else { - *out_width = static_cast<u32>(DisplayResolution::UndockedWidth); - *out_height = static_cast<u32>(DisplayResolution::UndockedHeight); + out_display_mode->width = static_cast<u32>(DisplayResolution::UndockedWidth); + out_display_mode->height = static_cast<u32>(DisplayResolution::UndockedHeight); } - *out_refresh_rate = 60.f; // This wouldn't seem to be correct for 30 fps games. - *out_unknown = 0; + out_display_mode->refresh_rate = 60.f; // This wouldn't seem to be correct for 30 fps games. + out_display_mode->unknown = 0; R_SUCCEED(); } diff --git a/src/core/hle/service/vi/system_display_service.h b/src/core/hle/service/vi/system_display_service.h index 63c1a4dc5..7228d826e 100644 --- a/src/core/hle/service/vi/system_display_service.h +++ b/src/core/hle/service/vi/system_display_service.h @@ -8,6 +8,7 @@ #include "core/hle/service/vi/shared_buffer_manager.h" namespace Service::VI { +struct DisplayMode; class Container; @@ -19,8 +20,9 @@ public: private: Result SetLayerZ(u32 z_value, u64 layer_id); Result SetLayerVisibility(bool visible, u64 layer_id); - Result GetDisplayMode(Out<u32> out_width, Out<u32> out_height, Out<f32> out_refresh_rate, - Out<u32> out_unknown); + Result ListDisplayModes(Out<u64> out_count, u64 display_id, + OutArray<DisplayMode, BufferAttr_HipcMapAlias> out_display_modes); + Result GetDisplayMode(Out<DisplayMode> out_display_mode, u64 display_id); Result GetSharedBufferMemoryHandleId( Out<s32> out_nvmap_handle, Out<u64> out_size, diff --git a/src/core/hle/service/vi/vi_types.h b/src/core/hle/service/vi/vi_types.h index 7f2c70aef..95ff66358 100644 --- a/src/core/hle/service/vi/vi_types.h +++ b/src/core/hle/service/vi/vi_types.h @@ -66,6 +66,14 @@ struct DisplayInfo { }; static_assert(sizeof(DisplayInfo) == 0x60, "DisplayInfo has wrong size"); +struct DisplayMode { + u32 width; + u32 height; + f32 refresh_rate; + u32 unknown; +}; +static_assert(sizeof(DisplayMode) == 0x10, "DisplayMode has wrong size"); + class NativeWindow final { public: constexpr explicit NativeWindow(s32 id_) : id{static_cast<u64>(id_)} {} |