summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorzarroboogs <36057965+zarroboogs@users.noreply.github.com>2019-04-06 22:02:55 +0200
committerzarroboogs <36057965+zarroboogs@users.noreply.github.com>2019-04-09 01:14:03 +0200
commitbe6466d5c0358216999ba1eb5f7f5d20649766be (patch)
tree20cf8895b4db73a64cdc1863d94e58b82cf59e51 /src/core/hle
parentMerge pull request #2300 from FernandoS27/null-shader (diff)
downloadyuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar.gz
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar.bz2
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar.lz
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar.xz
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.tar.zst
yuzu-be6466d5c0358216999ba1eb5f7f5d20649766be.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index c7f5bbf28..3c5c53e24 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -21,12 +21,13 @@
#include "core/hle/service/vi/display/vi_display.h"
#include "core/hle/service/vi/layer/vi_layer.h"
#include "core/perf_stats.h"
+#include "core/settings.h"
#include "video_core/renderer_base.h"
namespace Service::NVFlinger {
-constexpr std::size_t SCREEN_REFRESH_RATE = 60;
-constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / SCREEN_REFRESH_RATE);
+constexpr s64 frame_ticks = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 60);
+constexpr s64 frame_ticks_30fps = static_cast<s64>(Core::Timing::BASE_CLOCK_RATE / 30);
NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing) : core_timing{core_timing} {
displays.emplace_back(0, "Default");
@@ -36,13 +37,15 @@ NVFlinger::NVFlinger(Core::Timing::CoreTiming& core_timing) : core_timing{core_t
displays.emplace_back(4, "Null");
// Schedule the screen composition events
- composition_event =
- core_timing.RegisterEvent("ScreenComposition", [this](u64 userdata, s64 cycles_late) {
+ const auto ticks = Settings::values.force_30fps_mode ? frame_ticks_30fps : frame_ticks;
+
+ composition_event = core_timing.RegisterEvent(
+ "ScreenComposition", [this, ticks](u64 userdata, s64 cycles_late) {
Compose();
- this->core_timing.ScheduleEvent(frame_ticks - cycles_late, composition_event);
+ this->core_timing.ScheduleEvent(ticks - cycles_late, composition_event);
});
- core_timing.ScheduleEvent(frame_ticks, composition_event);
+ core_timing.ScheduleEvent(ticks, composition_event);
}
NVFlinger::~NVFlinger() {
@@ -62,6 +65,7 @@ std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) {
const auto itr =
std::find_if(displays.begin(), displays.end(),
[&](const VI::Display& display) { return display.GetName() == name; });
+
if (itr == displays.end()) {
return {};
}