summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/fs/path_util.cpp27
-rw-r--r--src/core/hle/service/am/applets/applet_web_browser.cpp10
-rw-r--r--src/video_core/command_classes/codecs/h264.cpp7
-rw-r--r--src/yuzu/configuration/configure_input_player_widget.cpp4
-rw-r--r--src/yuzu/configuration/configure_tas.ui8
-rw-r--r--src/yuzu/debugger/profiler.cpp12
-rw-r--r--src/yuzu/game_list.cpp3
7 files changed, 42 insertions, 29 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 43b79bd6d..1bcb897b5 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -82,32 +82,35 @@ public:
82 82
83private: 83private:
84 PathManagerImpl() { 84 PathManagerImpl() {
85 fs::path yuzu_path;
86 fs::path yuzu_path_cache;
87 fs::path yuzu_path_config;
88
85#ifdef _WIN32 89#ifdef _WIN32
86 auto yuzu_path = GetExeDirectory() / PORTABLE_DIR; 90 yuzu_path = GetExeDirectory() / PORTABLE_DIR;
87 91
88 if (!IsDir(yuzu_path)) { 92 if (!IsDir(yuzu_path)) {
89 yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; 93 yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR;
90 } 94 }
91 95
92 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 96 yuzu_path_cache = yuzu_path / CACHE_DIR;
93 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); 97 yuzu_path_config = yuzu_path / CONFIG_DIR;
94 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
95#else 98#else
96 auto yuzu_path = GetCurrentDir() / PORTABLE_DIR; 99 yuzu_path = GetCurrentDir() / PORTABLE_DIR;
97 100
98 if (Exists(yuzu_path) && IsDir(yuzu_path)) { 101 if (Exists(yuzu_path) && IsDir(yuzu_path)) {
99 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 102 yuzu_path_cache = yuzu_path / CACHE_DIR;
100 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); 103 yuzu_path_config = yuzu_path / CONFIG_DIR;
101 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
102 } else { 104 } else {
103 yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; 105 yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR;
104 106 yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR;
105 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); 107 yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR;
106 GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR);
107 GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR);
108 } 108 }
109#endif 109#endif
110 110
111 GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
112 GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache);
113 GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config);
111 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); 114 GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR);
112 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); 115 GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR);
113 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); 116 GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR);
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp
index 35f194961..927eeefff 100644
--- a/src/core/hle/service/am/applets/applet_web_browser.cpp
+++ b/src/core/hle/service/am/applets/applet_web_browser.cpp
@@ -24,6 +24,7 @@
24#include "core/hle/service/am/applets/applet_web_browser.h" 24#include "core/hle/service/am/applets/applet_web_browser.h"
25#include "core/hle/service/filesystem/filesystem.h" 25#include "core/hle/service/filesystem/filesystem.h"
26#include "core/hle/service/ns/pl_u.h" 26#include "core/hle/service/ns/pl_u.h"
27#include "core/loader/loader.h"
27 28
28namespace Service::AM::Applets { 29namespace Service::AM::Applets {
29 30
@@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id,
122 const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); 123 const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type);
123 124
124 if (nca == nullptr) { 125 if (nca == nullptr) {
126 if (nca_type == FileSys::ContentRecordType::HtmlDocument) {
127 LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS.");
128 FileSys::VirtualFile romfs;
129 system.GetAppLoader().ReadManualRomFS(romfs);
130 if (romfs != nullptr) {
131 return romfs;
132 }
133 }
134
125 LOG_ERROR(Service_AM, 135 LOG_ERROR(Service_AM,
126 "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", 136 "NCA of type={} with title_id={:016X} is not found in the ContentProvider!",
127 nca_type, title_id); 137 nca_type, title_id);
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp
index 51ee14c13..5519c4705 100644
--- a/src/video_core/command_classes/codecs/h264.cpp
+++ b/src/video_core/command_classes/codecs/h264.cpp
@@ -20,6 +20,8 @@
20 20
21#include <array> 21#include <array>
22#include <bit> 22#include <bit>
23
24#include "common/settings.h"
23#include "video_core/command_classes/codecs/h264.h" 25#include "video_core/command_classes/codecs/h264.h"
24#include "video_core/gpu.h" 26#include "video_core/gpu.h"
25#include "video_core/memory_manager.h" 27#include "video_core/memory_manager.h"
@@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister
96 (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); 98 (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2);
97 99
98 // TODO (ameerj): Where do we get this number, it seems to be particular for each stream 100 // TODO (ameerj): Where do we get this number, it seems to be particular for each stream
99 writer.WriteUe(6); // Max number of reference frames 101 const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue();
102 const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU;
103 const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u;
104 writer.WriteUe(max_num_ref_frames);
100 writer.WriteBit(false); 105 writer.WriteBit(false);
101 writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); 106 writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1);
102 writer.WriteUe(pic_height - 1); 107 writer.WriteUe(pic_height - 1);
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp
index da328d904..f31f86339 100644
--- a/src/yuzu/configuration/configure_input_player_widget.cpp
+++ b/src/yuzu/configuration/configure_input_player_widget.cpp
@@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) {
1837 const float led_size = 5.0f; 1837 const float led_size = 5.0f;
1838 const QPointF led_position = sideview_center + QPointF(0, -36); 1838 const QPointF led_position = sideview_center + QPointF(0, -36);
1839 int led_count = 0; 1839 int led_count = 0;
1840 for (const auto color : led_color) { 1840 for (const auto& color : led_color) {
1841 p.setBrush(color); 1841 p.setBrush(color);
1842 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); 1842 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
1843 } 1843 }
@@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) {
1933 const float led_size = 5.0f; 1933 const float led_size = 5.0f;
1934 const QPointF led_position = sideview_center + QPointF(0, -36); 1934 const QPointF led_position = sideview_center + QPointF(0, -36);
1935 int led_count = 0; 1935 int led_count = 0;
1936 for (const auto color : led_color) { 1936 for (const auto& color : led_color) {
1937 p.setBrush(color); 1937 p.setBrush(color);
1938 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); 1938 DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size);
1939 } 1939 }
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui
index 3972f9083..6caa19031 100644
--- a/src/yuzu/configuration/configure_tas.ui
+++ b/src/yuzu/configuration/configure_tas.ui
@@ -2,14 +2,6 @@
2<ui version="4.0"> 2<ui version="4.0">
3 <class>ConfigureTas</class> 3 <class>ConfigureTas</class>
4 <widget class="QDialog" name="ConfigureTas"> 4 <widget class="QDialog" name="ConfigureTas">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>337</width>
10 <height>316</height>
11 </rect>
12 </property>
13 <layout class="QVBoxLayout" name="verticalLayout_1"> 5 <layout class="QVBoxLayout" name="verticalLayout_1">
14 <item> 6 <item>
15 <layout class="QHBoxLayout" name="horizontalLayout_1"> 7 <layout class="QHBoxLayout" name="horizontalLayout_1">
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp
index 7a6f84d96..33110685a 100644
--- a/src/yuzu/debugger/profiler.cpp
+++ b/src/yuzu/debugger/profiler.cpp
@@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) {
143} 143}
144 144
145void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { 145void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) {
146 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 146 const auto mouse_position = ev->pos();
147 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
147 ev->accept(); 148 ev->accept();
148} 149}
149 150
150void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { 151void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) {
151 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 152 const auto mouse_position = ev->pos();
153 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
152 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); 154 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
153 ev->accept(); 155 ev->accept();
154} 156}
155 157
156void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { 158void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) {
157 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); 159 const auto mouse_position = ev->pos();
160 MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0);
158 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); 161 MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton);
159 ev->accept(); 162 ev->accept();
160} 163}
161 164
162void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { 165void MicroProfileWidget::wheelEvent(QWheelEvent* ev) {
163 MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 166 const auto wheel_position = ev->position().toPoint();
167 MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale,
164 ev->angleDelta().y() / 120); 168 ev->angleDelta().y() / 120);
165 ev->accept(); 169 ev->accept();
166} 170}
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index f9d949e75..ba54423ff 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} {
159 * @return true if the haystack contains all words of userinput 159 * @return true if the haystack contains all words of userinput
160 */ 160 */
161static bool ContainsAllWords(const QString& haystack, const QString& userinput) { 161static bool ContainsAllWords(const QString& haystack, const QString& userinput) {
162 const QStringList userinput_split = 162 const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts);
163 userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts);
164 163
165 return std::all_of(userinput_split.begin(), userinput_split.end(), 164 return std::all_of(userinput_split.begin(), userinput_split.end(),
166 [&haystack](const QString& s) { return haystack.contains(s); }); 165 [&haystack](const QString& s) { return haystack.contains(s); });