summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/settings.cpp2
-rw-r--r--src/common/settings.h2
-rw-r--r--src/core/hle/service/am/am.cpp12
-rw-r--r--src/core/hle/service/vi/vi.cpp27
-rw-r--r--src/core/telemetry_session.cpp2
-rw-r--r--src/video_core/video_core.cpp9
-rw-r--r--src/video_core/video_core.h2
7 files changed, 19 insertions, 37 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index dd3a3d456..6f3acee79 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -48,7 +48,6 @@ void LogSettings() {
48 log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); 48 log_setting("Core_UseMultiCore", values.use_multi_core.GetValue());
49 log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); 49 log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue());
50 log_setting("Renderer_UseResolutionScaling", values.resolution_setup.GetValue()); 50 log_setting("Renderer_UseResolutionScaling", values.resolution_setup.GetValue());
51 log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue());
52 log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue()); 51 log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue());
53 log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue()); 52 log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue());
54 log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); 53 log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue());
@@ -155,6 +154,7 @@ void UpdateRescalingInfo() {
155 info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale; 154 info.down_factor = static_cast<f32>(1U << info.down_shift) / info.up_scale;
156 info.size_up = info.up_scale * info.up_scale; 155 info.size_up = info.up_scale * info.up_scale;
157 info.size_shift = info.down_shift * 2; 156 info.size_shift = info.down_shift * 2;
157 info.active = info.up_scale != 1 || info.down_shift != 0;
158} 158}
159 159
160void RestoreGlobalState(bool is_powered_on) { 160void RestoreGlobalState(bool is_powered_on) {
diff --git a/src/common/settings.h b/src/common/settings.h
index f4df2fc95..2b11984b4 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -69,6 +69,7 @@ struct ResolutionScalingInfo {
69 f32 down_factor{1.0f}; 69 f32 down_factor{1.0f};
70 u32 size_up{1}; 70 u32 size_up{1};
71 u32 size_shift{0}; 71 u32 size_shift{0};
72 bool active{};
72}; 73};
73 74
74/** The BasicSetting class is a simple resource manager. It defines a label and default value 75/** The BasicSetting class is a simple resource manager. It defines a label and default value
@@ -472,7 +473,6 @@ struct Values {
472 473
473 ResolutionScalingInfo resolution_info{}; 474 ResolutionScalingInfo resolution_info{};
474 Setting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"}; 475 Setting<ResolutionSetup> resolution_setup{ResolutionSetup::Res1X, "resolution_setup"};
475 Setting<u16> resolution_factor{1, "resolution_factor"};
476 // *nix platforms may have issues with the borderless windowed fullscreen mode. 476 // *nix platforms may have issues with the borderless windowed fullscreen mode.
477 // Default to exclusive fullscreen on these platforms for now. 477 // Default to exclusive fullscreen on these platforms for now.
478 RangedSetting<FullscreenMode> fullscreen_mode{ 478 RangedSetting<FullscreenMode> fullscreen_mode{
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 50c2ace93..aee8d4f93 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -797,15 +797,11 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
797 rb.Push(ResultSuccess); 797 rb.Push(ResultSuccess);
798 798
799 if (Settings::values.use_docked_mode.GetValue()) { 799 if (Settings::values.use_docked_mode.GetValue()) {
800 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * 800 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth));
801 static_cast<u32>(Settings::values.resolution_factor.GetValue())); 801 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight));
802 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) *
803 static_cast<u32>(Settings::values.resolution_factor.GetValue()));
804 } else { 802 } else {
805 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * 803 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth));
806 static_cast<u32>(Settings::values.resolution_factor.GetValue())); 804 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight));
807 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) *
808 static_cast<u32>(Settings::values.resolution_factor.GetValue()));
809 } 805 }
810} 806}
811 807
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 63d5242c4..75ee3e5e4 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -541,11 +541,8 @@ private:
541 switch (transaction) { 541 switch (transaction) {
542 case TransactionId::Connect: { 542 case TransactionId::Connect: {
543 IGBPConnectRequestParcel request{ctx.ReadBuffer()}; 543 IGBPConnectRequestParcel request{ctx.ReadBuffer()};
544 IGBPConnectResponseParcel response{ 544 IGBPConnectResponseParcel response{static_cast<u32>(DisplayResolution::UndockedWidth),
545 static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedWidth) * 545 static_cast<u32>(DisplayResolution::UndockedHeight)};
546 Settings::values.resolution_factor.GetValue()),
547 static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) *
548 Settings::values.resolution_factor.GetValue())};
549 546
550 buffer_queue.Connect(); 547 buffer_queue.Connect();
551 548
@@ -775,15 +772,11 @@ private:
775 rb.Push(ResultSuccess); 772 rb.Push(ResultSuccess);
776 773
777 if (Settings::values.use_docked_mode.GetValue()) { 774 if (Settings::values.use_docked_mode.GetValue()) {
778 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * 775 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth));
779 static_cast<u32>(Settings::values.resolution_factor.GetValue())); 776 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight));
780 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) *
781 static_cast<u32>(Settings::values.resolution_factor.GetValue()));
782 } else { 777 } else {
783 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * 778 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth));
784 static_cast<u32>(Settings::values.resolution_factor.GetValue())); 779 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight));
785 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) *
786 static_cast<u32>(Settings::values.resolution_factor.GetValue()));
787 } 780 }
788 781
789 rb.PushRaw<float>(60.0f); // This wouldn't seem to be correct for 30 fps games. 782 rb.PushRaw<float>(60.0f); // This wouldn't seem to be correct for 30 fps games.
@@ -1063,10 +1056,8 @@ private:
1063 // This only returns the fixed values of 1280x720 and makes no distinguishing 1056 // This only returns the fixed values of 1280x720 and makes no distinguishing
1064 // between docked and undocked dimensions. We take the liberty of applying 1057 // between docked and undocked dimensions. We take the liberty of applying
1065 // the resolution scaling factor here. 1058 // the resolution scaling factor here.
1066 rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) * 1059 rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth));
1067 static_cast<u32>(Settings::values.resolution_factor.GetValue())); 1060 rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight));
1068 rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) *
1069 static_cast<u32>(Settings::values.resolution_factor.GetValue()));
1070 } 1061 }
1071 1062
1072 void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { 1063 void SetLayerScalingMode(Kernel::HLERequestContext& ctx) {
@@ -1099,8 +1090,6 @@ private:
1099 LOG_WARNING(Service_VI, "(STUBBED) called"); 1090 LOG_WARNING(Service_VI, "(STUBBED) called");
1100 1091
1101 DisplayInfo display_info; 1092 DisplayInfo display_info;
1102 display_info.width *= static_cast<u64>(Settings::values.resolution_factor.GetValue());
1103 display_info.height *= static_cast<u64>(Settings::values.resolution_factor.GetValue());
1104 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); 1093 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
1105 IPC::ResponseBuilder rb{ctx, 4}; 1094 IPC::ResponseBuilder rb{ctx, 4};
1106 rb.Push(ResultSuccess); 1095 rb.Push(ResultSuccess);
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp
index 191475f71..654db0b52 100644
--- a/src/core/telemetry_session.cpp
+++ b/src/core/telemetry_session.cpp
@@ -229,8 +229,6 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader,
229 AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); 229 AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue());
230 AddField(field_type, "Renderer_Backend", 230 AddField(field_type, "Renderer_Backend",
231 TranslateRenderer(Settings::values.renderer_backend.GetValue())); 231 TranslateRenderer(Settings::values.renderer_backend.GetValue()));
232 AddField(field_type, "Renderer_ResolutionFactor",
233 Settings::values.resolution_factor.GetValue());
234 AddField(field_type, "Renderer_UseSpeedLimit", Settings::values.use_speed_limit.GetValue()); 232 AddField(field_type, "Renderer_UseSpeedLimit", Settings::values.use_speed_limit.GetValue());
235 AddField(field_type, "Renderer_SpeedLimit", Settings::values.speed_limit.GetValue()); 233 AddField(field_type, "Renderer_SpeedLimit", Settings::values.speed_limit.GetValue());
236 AddField(field_type, "Renderer_UseDiskShaderCache", 234 AddField(field_type, "Renderer_UseDiskShaderCache",
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index cae543a51..508173db3 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -53,11 +53,10 @@ std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Cor
53 } 53 }
54} 54}
55 55
56u16 GetResolutionScaleFactor(const RendererBase& renderer) { 56float GetResolutionScaleFactor(const RendererBase& renderer) {
57 return static_cast<u16>( 57 return Settings::values.resolution_info.active
58 Settings::values.resolution_factor.GetValue() != 0 58 ? Settings::values.resolution_info.up_factor
59 ? Settings::values.resolution_factor.GetValue() 59 : renderer.GetRenderWindow().GetFramebufferLayout().GetScalingRatio();
60 : renderer.GetRenderWindow().GetFramebufferLayout().GetScalingRatio());
61} 60}
62 61
63} // namespace VideoCore 62} // namespace VideoCore
diff --git a/src/video_core/video_core.h b/src/video_core/video_core.h
index f5c27125d..f86877e86 100644
--- a/src/video_core/video_core.h
+++ b/src/video_core/video_core.h
@@ -25,6 +25,6 @@ class RendererBase;
25/// Creates an emulated GPU instance using the given system context. 25/// Creates an emulated GPU instance using the given system context.
26std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system); 26std::unique_ptr<Tegra::GPU> CreateGPU(Core::Frontend::EmuWindow& emu_window, Core::System& system);
27 27
28u16 GetResolutionScaleFactor(const RendererBase& renderer); 28float GetResolutionScaleFactor(const RendererBase& renderer);
29 29
30} // namespace VideoCore 30} // namespace VideoCore