From 9359655712e99d6e49129a0243cdeec4eac6b250 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Fri, 16 Nov 2018 18:07:42 +1100 Subject: Report resolution scaling support for vi and am Specifying an internal resolution in yuzu now will report the scaled changes to vi and am. --- src/core/hle/service/vi/vi.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/core/hle/service/vi') diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index d764b2406..85c74c516 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -494,7 +494,9 @@ private: if (transaction == TransactionId::Connect) { IGBPConnectRequestParcel request{ctx.ReadBuffer()}; - IGBPConnectResponseParcel response{1280, 720}; + IGBPConnectResponseParcel response{ + static_cast(1280 * Settings::values.resolution_factor), + static_cast(720 * Settings::values.resolution_factor)}; ctx.WriteBuffer(response.Serialize()); } else if (transaction == TransactionId::SetPreallocatedBuffer) { IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()}; @@ -670,11 +672,15 @@ private: rb.Push(RESULT_SUCCESS); if (Settings::values.use_docked_mode) { - rb.Push(static_cast(Service::VI::DisplayResolution::DockedWidth)); - rb.Push(static_cast(Service::VI::DisplayResolution::DockedHeight)); + rb.Push(static_cast(Service::VI::DisplayResolution::DockedWidth) * + static_cast(Settings::values.resolution_factor)); + rb.Push(static_cast(Service::VI::DisplayResolution::DockedHeight) * + static_cast(Settings::values.resolution_factor)); } else { - rb.Push(static_cast(Service::VI::DisplayResolution::UndockedWidth)); - rb.Push(static_cast(Service::VI::DisplayResolution::UndockedHeight)); + rb.Push(static_cast(Service::VI::DisplayResolution::UndockedWidth) * + static_cast(Settings::values.resolution_factor)); + rb.Push(static_cast(Service::VI::DisplayResolution::UndockedHeight) * + static_cast(Settings::values.resolution_factor)); } rb.PushRaw(60.0f); @@ -879,11 +885,15 @@ private: rb.Push(RESULT_SUCCESS); if (Settings::values.use_docked_mode) { - rb.Push(static_cast(DisplayResolution::DockedWidth)); - rb.Push(static_cast(DisplayResolution::DockedHeight)); + rb.Push(static_cast(DisplayResolution::DockedWidth) * + static_cast(Settings::values.resolution_factor)); + rb.Push(static_cast(DisplayResolution::DockedHeight) * + static_cast(Settings::values.resolution_factor)); } else { - rb.Push(static_cast(DisplayResolution::UndockedWidth)); - rb.Push(static_cast(DisplayResolution::UndockedHeight)); + rb.Push(static_cast(DisplayResolution::UndockedWidth) * + static_cast(Settings::values.resolution_factor)); + rb.Push(static_cast(DisplayResolution::UndockedHeight) * + static_cast(Settings::values.resolution_factor)); } } @@ -900,6 +910,8 @@ private: void ListDisplays(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp{ctx}; DisplayInfo display_info; + display_info.width *= static_cast(Settings::values.resolution_factor); + display_info.height *= static_cast(Settings::values.resolution_factor); ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); IPC::ResponseBuilder rb{ctx, 4}; rb.Push(RESULT_SUCCESS); -- cgit v1.2.3 From 60fecee1eceb11c3e2146012831150dd01e07f1a Mon Sep 17 00:00:00 2001 From: David Marcec Date: Mon, 19 Nov 2018 15:20:47 +1100 Subject: Removed hard coded values for width and height --- src/core/hle/service/vi/vi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/vi') diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 85c74c516..15b2cddcb 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -495,8 +495,10 @@ private: if (transaction == TransactionId::Connect) { IGBPConnectRequestParcel request{ctx.ReadBuffer()}; IGBPConnectResponseParcel response{ - static_cast(1280 * Settings::values.resolution_factor), - static_cast(720 * Settings::values.resolution_factor)}; + static_cast(static_cast(DisplayResolution::UndockedWidth) * + Settings::values.resolution_factor), + static_cast(static_cast(DisplayResolution::UndockedHeight) * + Settings::values.resolution_factor)}; ctx.WriteBuffer(response.Serialize()); } else if (transaction == TransactionId::SetPreallocatedBuffer) { IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()}; -- cgit v1.2.3