Merge pull request #1708 from ogniK5377/res-scale

Report resolution scaling support for vi and am
This commit is contained in:
bunnei 2018-11-23 23:32:19 -05:00 committed by GitHub
commit e65966bcfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 60 deletions

View File

@ -483,11 +483,15 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
if (Settings::values.use_docked_mode) { if (Settings::values.use_docked_mode) {
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth)); rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) *
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} else { } else {
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth)); rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) *
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} }
LOG_DEBUG(Service_AM, "called"); LOG_DEBUG(Service_AM, "called");

View File

@ -510,7 +510,11 @@ private:
if (transaction == TransactionId::Connect) { if (transaction == TransactionId::Connect) {
IGBPConnectRequestParcel request{ctx.ReadBuffer()}; IGBPConnectRequestParcel request{ctx.ReadBuffer()};
IGBPConnectResponseParcel response{1280, 720}; IGBPConnectResponseParcel response{
static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedWidth) *
Settings::values.resolution_factor),
static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) *
Settings::values.resolution_factor)};
ctx.WriteBuffer(response.Serialize()); ctx.WriteBuffer(response.Serialize());
} else if (transaction == TransactionId::SetPreallocatedBuffer) { } else if (transaction == TransactionId::SetPreallocatedBuffer) {
IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()}; IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()};
@ -692,11 +696,15 @@ private:
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
if (Settings::values.use_docked_mode) { if (Settings::values.use_docked_mode) {
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth)); rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) *
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} else { } else {
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth)); rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) *
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} }
rb.PushRaw<float>(60.0f); rb.PushRaw<float>(60.0f);
@ -901,11 +909,15 @@ private:
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
if (Settings::values.use_docked_mode) { if (Settings::values.use_docked_mode) {
rb.Push(static_cast<u64>(DisplayResolution::DockedWidth)); rb.Push(static_cast<u64>(DisplayResolution::DockedWidth) *
rb.Push(static_cast<u64>(DisplayResolution::DockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u64>(DisplayResolution::DockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} else { } else {
rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth)); rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) *
rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight)); static_cast<u32>(Settings::values.resolution_factor));
rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) *
static_cast<u32>(Settings::values.resolution_factor));
} }
} }
@ -922,6 +934,8 @@ private:
void ListDisplays(Kernel::HLERequestContext& ctx) { void ListDisplays(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
DisplayInfo display_info; DisplayInfo display_info;
display_info.width *= static_cast<u64>(Settings::values.resolution_factor);
display_info.height *= static_cast<u64>(Settings::values.resolution_factor);
ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
IPC::ResponseBuilder rb{ctx, 4}; IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);

View File

@ -61,7 +61,7 @@
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Internal Resolution:(Currently does nothing.)</string> <string>Internal Resolution</string>
</property> </property>
</widget> </widget>
</item> </item>