diff options
25 files changed, 143 insertions, 111 deletions
diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp index d72d67994..cee8b12dd 100644 --- a/src/audio_core/time_stretch.cpp +++ b/src/audio_core/time_stretch.cpp | |||
| @@ -10,8 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | namespace AudioCore { | 11 | namespace AudioCore { |
| 12 | 12 | ||
| 13 | TimeStretcher::TimeStretcher(u32 sample_rate, u32 channel_count) | 13 | TimeStretcher::TimeStretcher(u32 sample_rate, u32 channel_count) : m_sample_rate{sample_rate} { |
| 14 | : m_sample_rate(sample_rate), m_channel_count(channel_count) { | ||
| 15 | m_sound_touch.setChannels(channel_count); | 14 | m_sound_touch.setChannels(channel_count); |
| 16 | m_sound_touch.setSampleRate(sample_rate); | 15 | m_sound_touch.setSampleRate(sample_rate); |
| 17 | m_sound_touch.setPitch(1.0); | 16 | m_sound_touch.setPitch(1.0); |
diff --git a/src/audio_core/time_stretch.h b/src/audio_core/time_stretch.h index decd760f1..bb2270b96 100644 --- a/src/audio_core/time_stretch.h +++ b/src/audio_core/time_stretch.h | |||
| @@ -27,7 +27,6 @@ public: | |||
| 27 | 27 | ||
| 28 | private: | 28 | private: |
| 29 | u32 m_sample_rate; | 29 | u32 m_sample_rate; |
| 30 | u32 m_channel_count; | ||
| 31 | soundtouch::SoundTouch m_sound_touch; | 30 | soundtouch::SoundTouch m_sound_touch; |
| 32 | double m_stretch_ratio = 1.0; | 31 | double m_stretch_ratio = 1.0; |
| 33 | }; | 32 | }; |
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 9f5918851..6d5218465 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -196,6 +196,7 @@ void FileBackend::Write(const Entry& entry) { | |||
| 196 | SUB(Service, NFP) \ | 196 | SUB(Service, NFP) \ |
| 197 | SUB(Service, NIFM) \ | 197 | SUB(Service, NIFM) \ |
| 198 | SUB(Service, NIM) \ | 198 | SUB(Service, NIM) \ |
| 199 | SUB(Service, NPNS) \ | ||
| 199 | SUB(Service, NS) \ | 200 | SUB(Service, NS) \ |
| 200 | SUB(Service, NVDRV) \ | 201 | SUB(Service, NVDRV) \ |
| 201 | SUB(Service, PCIE) \ | 202 | SUB(Service, PCIE) \ |
| @@ -204,10 +205,12 @@ void FileBackend::Write(const Entry& entry) { | |||
| 204 | SUB(Service, PM) \ | 205 | SUB(Service, PM) \ |
| 205 | SUB(Service, PREPO) \ | 206 | SUB(Service, PREPO) \ |
| 206 | SUB(Service, PSC) \ | 207 | SUB(Service, PSC) \ |
| 208 | SUB(Service, PSM) \ | ||
| 207 | SUB(Service, SET) \ | 209 | SUB(Service, SET) \ |
| 208 | SUB(Service, SM) \ | 210 | SUB(Service, SM) \ |
| 209 | SUB(Service, SPL) \ | 211 | SUB(Service, SPL) \ |
| 210 | SUB(Service, SSL) \ | 212 | SUB(Service, SSL) \ |
| 213 | SUB(Service, TCAP) \ | ||
| 211 | SUB(Service, Time) \ | 214 | SUB(Service, Time) \ |
| 212 | SUB(Service, USB) \ | 215 | SUB(Service, USB) \ |
| 213 | SUB(Service, VI) \ | 216 | SUB(Service, VI) \ |
diff --git a/src/common/logging/log.h b/src/common/logging/log.h index c9161155a..d4ec31ec3 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h | |||
| @@ -83,6 +83,7 @@ enum class Class : ClassType { | |||
| 83 | Service_NFP, ///< The NFP service | 83 | Service_NFP, ///< The NFP service |
| 84 | Service_NIFM, ///< The NIFM (Network interface) service | 84 | Service_NIFM, ///< The NIFM (Network interface) service |
| 85 | Service_NIM, ///< The NIM service | 85 | Service_NIM, ///< The NIM service |
| 86 | Service_NPNS, ///< The NPNS service | ||
| 86 | Service_NS, ///< The NS services | 87 | Service_NS, ///< The NS services |
| 87 | Service_NVDRV, ///< The NVDRV (Nvidia driver) service | 88 | Service_NVDRV, ///< The NVDRV (Nvidia driver) service |
| 88 | Service_PCIE, ///< The PCIe service | 89 | Service_PCIE, ///< The PCIe service |
| @@ -96,6 +97,7 @@ enum class Class : ClassType { | |||
| 96 | Service_SM, ///< The SM (Service manager) service | 97 | Service_SM, ///< The SM (Service manager) service |
| 97 | Service_SPL, ///< The SPL service | 98 | Service_SPL, ///< The SPL service |
| 98 | Service_SSL, ///< The SSL service | 99 | Service_SSL, ///< The SSL service |
| 100 | Service_TCAP, ///< The TCAP service. | ||
| 99 | Service_Time, ///< The time service | 101 | Service_Time, ///< The time service |
| 100 | Service_USB, ///< The USB (Universal Serial Bus) service | 102 | Service_USB, ///< The USB (Universal Serial Bus) service |
| 101 | Service_VI, ///< The VI (Video interface) service | 103 | Service_VI, ///< The VI (Video interface) service |
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index fd0786068..fefc3c747 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -713,7 +713,6 @@ void KeyManager::DeriveBase() { | |||
| 713 | 713 | ||
| 714 | const auto sbk = GetKey(S128KeyType::SecureBoot); | 714 | const auto sbk = GetKey(S128KeyType::SecureBoot); |
| 715 | const auto tsec = GetKey(S128KeyType::TSEC); | 715 | const auto tsec = GetKey(S128KeyType::TSEC); |
| 716 | const auto master_source = GetKey(S128KeyType::Source, static_cast<u64>(SourceKeyType::Master)); | ||
| 717 | 716 | ||
| 718 | for (size_t i = 0; i < revisions.size(); ++i) { | 717 | for (size_t i = 0; i < revisions.size(); ++i) { |
| 719 | if (!revisions[i]) | 718 | if (!revisions[i]) |
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index bfe50da73..3824c74e0 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp | |||
| @@ -472,10 +472,14 @@ bool VfsRawCopy(const VirtualFile& src, const VirtualFile& dest, std::size_t blo | |||
| 472 | std::vector<u8> temp(std::min(block_size, src->GetSize())); | 472 | std::vector<u8> temp(std::min(block_size, src->GetSize())); |
| 473 | for (std::size_t i = 0; i < src->GetSize(); i += block_size) { | 473 | for (std::size_t i = 0; i < src->GetSize(); i += block_size) { |
| 474 | const auto read = std::min(block_size, src->GetSize() - i); | 474 | const auto read = std::min(block_size, src->GetSize() - i); |
| 475 | const auto block = src->Read(temp.data(), read, i); | ||
| 476 | 475 | ||
| 477 | if (dest->Write(temp.data(), read, i) != read) | 476 | if (src->Read(temp.data(), read, i) != read) { |
| 478 | return false; | 477 | return false; |
| 478 | } | ||
| 479 | |||
| 480 | if (dest->Write(temp.data(), read, i) != read) { | ||
| 481 | return false; | ||
| 482 | } | ||
| 479 | } | 483 | } |
| 480 | 484 | ||
| 481 | return true; | 485 | return true; |
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 06f7d1b15..3cac1b4ff 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <random> | 5 | #include <random> |
| 6 | #include <boost/optional.hpp> | 6 | |
| 7 | #include "common/file_util.h" | 7 | #include "common/file_util.h" |
| 8 | #include "core/hle/service/acc/profile_manager.h" | 8 | #include "core/hle/service/acc/profile_manager.h" |
| 9 | #include "core/settings.h" | 9 | #include "core/settings.h" |
| @@ -58,11 +58,11 @@ ProfileManager::~ProfileManager() { | |||
| 58 | 58 | ||
| 59 | /// After a users creation it needs to be "registered" to the system. AddToProfiles handles the | 59 | /// After a users creation it needs to be "registered" to the system. AddToProfiles handles the |
| 60 | /// internal management of the users profiles | 60 | /// internal management of the users profiles |
| 61 | boost::optional<std::size_t> ProfileManager::AddToProfiles(const ProfileInfo& user) { | 61 | std::optional<std::size_t> ProfileManager::AddToProfiles(const ProfileInfo& profile) { |
| 62 | if (user_count >= MAX_USERS) { | 62 | if (user_count >= MAX_USERS) { |
| 63 | return boost::none; | 63 | return {}; |
| 64 | } | 64 | } |
| 65 | profiles[user_count] = user; | 65 | profiles[user_count] = profile; |
| 66 | return user_count++; | 66 | return user_count++; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| @@ -81,7 +81,7 @@ bool ProfileManager::RemoveProfileAtIndex(std::size_t index) { | |||
| 81 | 81 | ||
| 82 | /// Helper function to register a user to the system | 82 | /// Helper function to register a user to the system |
| 83 | ResultCode ProfileManager::AddUser(const ProfileInfo& user) { | 83 | ResultCode ProfileManager::AddUser(const ProfileInfo& user) { |
| 84 | if (AddToProfiles(user) == boost::none) { | 84 | if (!AddToProfiles(user)) { |
| 85 | return ERROR_TOO_MANY_USERS; | 85 | return ERROR_TOO_MANY_USERS; |
| 86 | } | 86 | } |
| 87 | return RESULT_SUCCESS; | 87 | return RESULT_SUCCESS; |
| @@ -126,37 +126,40 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) | |||
| 126 | return CreateNewUser(uuid, username_output); | 126 | return CreateNewUser(uuid, username_output); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | boost::optional<UUID> ProfileManager::GetUser(std::size_t index) const { | 129 | std::optional<UUID> ProfileManager::GetUser(std::size_t index) const { |
| 130 | if (index >= MAX_USERS) | 130 | if (index >= MAX_USERS) { |
| 131 | return boost::none; | 131 | return {}; |
| 132 | } | ||
| 133 | |||
| 132 | return profiles[index].user_uuid; | 134 | return profiles[index].user_uuid; |
| 133 | } | 135 | } |
| 134 | 136 | ||
| 135 | /// Returns a users profile index based on their user id. | 137 | /// Returns a users profile index based on their user id. |
| 136 | boost::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const { | 138 | std::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const { |
| 137 | if (!uuid) { | 139 | if (!uuid) { |
| 138 | return boost::none; | 140 | return {}; |
| 139 | } | 141 | } |
| 140 | auto iter = std::find_if(profiles.begin(), profiles.end(), | 142 | |
| 141 | [&uuid](const ProfileInfo& p) { return p.user_uuid == uuid; }); | 143 | const auto iter = std::find_if(profiles.begin(), profiles.end(), |
| 144 | [&uuid](const ProfileInfo& p) { return p.user_uuid == uuid; }); | ||
| 142 | if (iter == profiles.end()) { | 145 | if (iter == profiles.end()) { |
| 143 | return boost::none; | 146 | return {}; |
| 144 | } | 147 | } |
| 148 | |||
| 145 | return static_cast<std::size_t>(std::distance(profiles.begin(), iter)); | 149 | return static_cast<std::size_t>(std::distance(profiles.begin(), iter)); |
| 146 | } | 150 | } |
| 147 | 151 | ||
| 148 | /// Returns a users profile index based on their profile | 152 | /// Returns a users profile index based on their profile |
| 149 | boost::optional<std::size_t> ProfileManager::GetUserIndex(const ProfileInfo& user) const { | 153 | std::optional<std::size_t> ProfileManager::GetUserIndex(const ProfileInfo& user) const { |
| 150 | return GetUserIndex(user.user_uuid); | 154 | return GetUserIndex(user.user_uuid); |
| 151 | } | 155 | } |
| 152 | 156 | ||
| 153 | /// Returns the data structure used by the switch when GetProfileBase is called on acc:* | 157 | /// Returns the data structure used by the switch when GetProfileBase is called on acc:* |
| 154 | bool ProfileManager::GetProfileBase(boost::optional<std::size_t> index, | 158 | bool ProfileManager::GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const { |
| 155 | ProfileBase& profile) const { | 159 | if (!index || index >= MAX_USERS) { |
| 156 | if (index == boost::none || index >= MAX_USERS) { | ||
| 157 | return false; | 160 | return false; |
| 158 | } | 161 | } |
| 159 | const auto& prof_info = profiles[index.get()]; | 162 | const auto& prof_info = profiles[*index]; |
| 160 | profile.user_uuid = prof_info.user_uuid; | 163 | profile.user_uuid = prof_info.user_uuid; |
| 161 | profile.username = prof_info.username; | 164 | profile.username = prof_info.username; |
| 162 | profile.timestamp = prof_info.creation_time; | 165 | profile.timestamp = prof_info.creation_time; |
| @@ -165,7 +168,7 @@ bool ProfileManager::GetProfileBase(boost::optional<std::size_t> index, | |||
| 165 | 168 | ||
| 166 | /// Returns the data structure used by the switch when GetProfileBase is called on acc:* | 169 | /// Returns the data structure used by the switch when GetProfileBase is called on acc:* |
| 167 | bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const { | 170 | bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const { |
| 168 | auto idx = GetUserIndex(uuid); | 171 | const auto idx = GetUserIndex(uuid); |
| 169 | return GetProfileBase(idx, profile); | 172 | return GetProfileBase(idx, profile); |
| 170 | } | 173 | } |
| 171 | 174 | ||
| @@ -192,7 +195,7 @@ std::size_t ProfileManager::GetOpenUserCount() const { | |||
| 192 | 195 | ||
| 193 | /// Checks if a user id exists in our profile manager | 196 | /// Checks if a user id exists in our profile manager |
| 194 | bool ProfileManager::UserExists(UUID uuid) const { | 197 | bool ProfileManager::UserExists(UUID uuid) const { |
| 195 | return (GetUserIndex(uuid) != boost::none); | 198 | return GetUserIndex(uuid) != std::nullopt; |
| 196 | } | 199 | } |
| 197 | 200 | ||
| 198 | bool ProfileManager::UserExistsIndex(std::size_t index) const { | 201 | bool ProfileManager::UserExistsIndex(std::size_t index) const { |
| @@ -203,21 +206,23 @@ bool ProfileManager::UserExistsIndex(std::size_t index) const { | |||
| 203 | 206 | ||
| 204 | /// Opens a specific user | 207 | /// Opens a specific user |
| 205 | void ProfileManager::OpenUser(UUID uuid) { | 208 | void ProfileManager::OpenUser(UUID uuid) { |
| 206 | auto idx = GetUserIndex(uuid); | 209 | const auto idx = GetUserIndex(uuid); |
| 207 | if (idx == boost::none) { | 210 | if (!idx) { |
| 208 | return; | 211 | return; |
| 209 | } | 212 | } |
| 210 | profiles[idx.get()].is_open = true; | 213 | |
| 214 | profiles[*idx].is_open = true; | ||
| 211 | last_opened_user = uuid; | 215 | last_opened_user = uuid; |
| 212 | } | 216 | } |
| 213 | 217 | ||
| 214 | /// Closes a specific user | 218 | /// Closes a specific user |
| 215 | void ProfileManager::CloseUser(UUID uuid) { | 219 | void ProfileManager::CloseUser(UUID uuid) { |
| 216 | auto idx = GetUserIndex(uuid); | 220 | const auto idx = GetUserIndex(uuid); |
| 217 | if (idx == boost::none) { | 221 | if (!idx) { |
| 218 | return; | 222 | return; |
| 219 | } | 223 | } |
| 220 | profiles[idx.get()].is_open = false; | 224 | |
| 225 | profiles[*idx].is_open = false; | ||
| 221 | } | 226 | } |
| 222 | 227 | ||
| 223 | /// Gets all valid user ids on the system | 228 | /// Gets all valid user ids on the system |
| @@ -247,10 +252,10 @@ UUID ProfileManager::GetLastOpenedUser() const { | |||
| 247 | } | 252 | } |
| 248 | 253 | ||
| 249 | /// Return the users profile base and the unknown arbitary data. | 254 | /// Return the users profile base and the unknown arbitary data. |
| 250 | bool ProfileManager::GetProfileBaseAndData(boost::optional<std::size_t> index, ProfileBase& profile, | 255 | bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile, |
| 251 | ProfileData& data) const { | 256 | ProfileData& data) const { |
| 252 | if (GetProfileBase(index, profile)) { | 257 | if (GetProfileBase(index, profile)) { |
| 253 | data = profiles[index.get()].data; | 258 | data = profiles[*index].data; |
| 254 | return true; | 259 | return true; |
| 255 | } | 260 | } |
| 256 | return false; | 261 | return false; |
| @@ -259,7 +264,7 @@ bool ProfileManager::GetProfileBaseAndData(boost::optional<std::size_t> index, P | |||
| 259 | /// Return the users profile base and the unknown arbitary data. | 264 | /// Return the users profile base and the unknown arbitary data. |
| 260 | bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile, | 265 | bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile, |
| 261 | ProfileData& data) const { | 266 | ProfileData& data) const { |
| 262 | auto idx = GetUserIndex(uuid); | 267 | const auto idx = GetUserIndex(uuid); |
| 263 | return GetProfileBaseAndData(idx, profile, data); | 268 | return GetProfileBaseAndData(idx, profile, data); |
| 264 | } | 269 | } |
| 265 | 270 | ||
| @@ -277,8 +282,8 @@ bool ProfileManager::CanSystemRegisterUser() const { | |||
| 277 | } | 282 | } |
| 278 | 283 | ||
| 279 | bool ProfileManager::RemoveUser(UUID uuid) { | 284 | bool ProfileManager::RemoveUser(UUID uuid) { |
| 280 | auto index = GetUserIndex(uuid); | 285 | const auto index = GetUserIndex(uuid); |
| 281 | if (index == boost::none) { | 286 | if (!index) { |
| 282 | return false; | 287 | return false; |
| 283 | } | 288 | } |
| 284 | 289 | ||
| @@ -289,8 +294,8 @@ bool ProfileManager::RemoveUser(UUID uuid) { | |||
| 289 | } | 294 | } |
| 290 | 295 | ||
| 291 | bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) { | 296 | bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) { |
| 292 | auto index = GetUserIndex(uuid); | 297 | const auto index = GetUserIndex(uuid); |
| 293 | if (profile_new.user_uuid == UUID(INVALID_UUID) || index == boost::none) { | 298 | if (!index || profile_new.user_uuid == UUID(INVALID_UUID)) { |
| 294 | return false; | 299 | return false; |
| 295 | } | 300 | } |
| 296 | 301 | ||
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h index 235208d56..1cd2e51b2 100644 --- a/src/core/hle/service/acc/profile_manager.h +++ b/src/core/hle/service/acc/profile_manager.h | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <optional> | ||
| 8 | 9 | ||
| 9 | #include "boost/optional.hpp" | ||
| 10 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| 11 | #include "common/swap.h" | 11 | #include "common/swap.h" |
| 12 | #include "core/hle/result.h" | 12 | #include "core/hle/result.h" |
| @@ -96,13 +96,13 @@ public: | |||
| 96 | ResultCode AddUser(const ProfileInfo& user); | 96 | ResultCode AddUser(const ProfileInfo& user); |
| 97 | ResultCode CreateNewUser(UUID uuid, const ProfileUsername& username); | 97 | ResultCode CreateNewUser(UUID uuid, const ProfileUsername& username); |
| 98 | ResultCode CreateNewUser(UUID uuid, const std::string& username); | 98 | ResultCode CreateNewUser(UUID uuid, const std::string& username); |
| 99 | boost::optional<UUID> GetUser(std::size_t index) const; | 99 | std::optional<UUID> GetUser(std::size_t index) const; |
| 100 | boost::optional<std::size_t> GetUserIndex(const UUID& uuid) const; | 100 | std::optional<std::size_t> GetUserIndex(const UUID& uuid) const; |
| 101 | boost::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const; | 101 | std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const; |
| 102 | bool GetProfileBase(boost::optional<std::size_t> index, ProfileBase& profile) const; | 102 | bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const; |
| 103 | bool GetProfileBase(UUID uuid, ProfileBase& profile) const; | 103 | bool GetProfileBase(UUID uuid, ProfileBase& profile) const; |
| 104 | bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const; | 104 | bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const; |
| 105 | bool GetProfileBaseAndData(boost::optional<std::size_t> index, ProfileBase& profile, | 105 | bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile, |
| 106 | ProfileData& data) const; | 106 | ProfileData& data) const; |
| 107 | bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, ProfileData& data) const; | 107 | bool GetProfileBaseAndData(UUID uuid, ProfileBase& profile, ProfileData& data) const; |
| 108 | bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile, | 108 | bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile, |
| @@ -120,16 +120,16 @@ public: | |||
| 120 | bool CanSystemRegisterUser() const; | 120 | bool CanSystemRegisterUser() const; |
| 121 | 121 | ||
| 122 | bool RemoveUser(UUID uuid); | 122 | bool RemoveUser(UUID uuid); |
| 123 | bool SetProfileBase(UUID uuid, const ProfileBase& profile); | 123 | bool SetProfileBase(UUID uuid, const ProfileBase& profile_new); |
| 124 | 124 | ||
| 125 | private: | 125 | private: |
| 126 | void ParseUserSaveFile(); | 126 | void ParseUserSaveFile(); |
| 127 | void WriteUserSaveFile(); | 127 | void WriteUserSaveFile(); |
| 128 | std::optional<std::size_t> AddToProfiles(const ProfileInfo& profile); | ||
| 129 | bool RemoveProfileAtIndex(std::size_t index); | ||
| 128 | 130 | ||
| 129 | std::array<ProfileInfo, MAX_USERS> profiles{}; | 131 | std::array<ProfileInfo, MAX_USERS> profiles{}; |
| 130 | std::size_t user_count = 0; | 132 | std::size_t user_count = 0; |
| 131 | boost::optional<std::size_t> AddToProfiles(const ProfileInfo& profile); | ||
| 132 | bool RemoveProfileAtIndex(std::size_t index); | ||
| 133 | UUID last_opened_user{INVALID_UUID}; | 133 | UUID last_opened_user{INVALID_UUID}; |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 4ed66d817..59aafd616 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -743,7 +743,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { | |||
| 743 | 743 | ||
| 744 | Account::ProfileManager profile_manager{}; | 744 | Account::ProfileManager profile_manager{}; |
| 745 | const auto uuid = profile_manager.GetUser(Settings::values.current_user); | 745 | const auto uuid = profile_manager.GetUser(Settings::values.current_user); |
| 746 | ASSERT(uuid != boost::none); | 746 | ASSERT(uuid != std::nullopt); |
| 747 | params.current_user = uuid->uuid; | 747 | params.current_user = uuid->uuid; |
| 748 | 748 | ||
| 749 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 749 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 428069df2..54305cf05 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -24,8 +24,8 @@ namespace Service::AOC { | |||
| 24 | constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000; | 24 | constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000; |
| 25 | constexpr u64 DLC_BASE_TO_AOC_ID = 0x1000; | 25 | constexpr u64 DLC_BASE_TO_AOC_ID = 0x1000; |
| 26 | 26 | ||
| 27 | static bool CheckAOCTitleIDMatchesBase(u64 base, u64 aoc) { | 27 | static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { |
| 28 | return (aoc & DLC_BASE_TITLE_ID_MASK) == base; | 28 | return (title_id & DLC_BASE_TITLE_ID_MASK) == base; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | static std::vector<u64> AccumulateAOCTitleIDs() { | 31 | static std::vector<u64> AccumulateAOCTitleIDs() { |
| @@ -74,7 +74,7 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) { | |||
| 74 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); | 74 | const auto current = Core::System::GetInstance().CurrentProcess()->GetTitleID(); |
| 75 | rb.Push<u32>(static_cast<u32>( | 75 | rb.Push<u32>(static_cast<u32>( |
| 76 | std::count_if(add_on_content.begin(), add_on_content.end(), | 76 | std::count_if(add_on_content.begin(), add_on_content.end(), |
| 77 | [¤t](u64 tid) { return (tid & DLC_BASE_TITLE_ID_MASK) == current; }))); | 77 | [current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); }))); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) { | 80 | void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index b06e65a77..4b4d1324f 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -108,9 +108,10 @@ void Controller_NPad::OnInit() { | |||
| 108 | styleset_changed_event = | 108 | styleset_changed_event = |
| 109 | Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "npad:NpadStyleSetChanged"); | 109 | Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, "npad:NpadStyleSetChanged"); |
| 110 | 110 | ||
| 111 | if (!IsControllerActivated()) | 111 | if (!IsControllerActivated()) { |
| 112 | return; | 112 | return; |
| 113 | std::size_t controller{}; | 113 | } |
| 114 | |||
| 114 | if (style.raw == 0) { | 115 | if (style.raw == 0) { |
| 115 | // We want to support all controllers | 116 | // We want to support all controllers |
| 116 | style.handheld.Assign(1); | 117 | style.handheld.Assign(1); |
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 7d95816fe..c716a462b 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -74,10 +74,6 @@ double PerfStats::GetLastFrameTimeScale() { | |||
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { | 76 | void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { |
| 77 | // Max lag caused by slow frames. Can be adjusted to compensate for too many slow frames. Higher | ||
| 78 | // values increase the time needed to recover and limit framerate again after spikes. | ||
| 79 | constexpr microseconds MAX_LAG_TIME_US = 25000us; | ||
| 80 | |||
| 81 | if (!Settings::values.use_frame_limit) { | 77 | if (!Settings::values.use_frame_limit) { |
| 82 | return; | 78 | return; |
| 83 | } | 79 | } |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index bca014a4a..78ba29fc1 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -155,7 +155,6 @@ void Maxwell3D::ProcessQueryGet() { | |||
| 155 | ASSERT_MSG(regs.query.query_get.unit == Regs::QueryUnit::Crop, | 155 | ASSERT_MSG(regs.query.query_get.unit == Regs::QueryUnit::Crop, |
| 156 | "Units other than CROP are unimplemented"); | 156 | "Units other than CROP are unimplemented"); |
| 157 | 157 | ||
| 158 | u32 value = Memory::Read32(*address); | ||
| 159 | u64 result = 0; | 158 | u64 result = 0; |
| 160 | 159 | ||
| 161 | // TODO(Subv): Support the other query variables | 160 | // TODO(Subv): Support the other query variables |
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 6cd08d28b..af7756266 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -79,6 +79,7 @@ union Attribute { | |||
| 79 | constexpr explicit Attribute(u64 value) : value(value) {} | 79 | constexpr explicit Attribute(u64 value) : value(value) {} |
| 80 | 80 | ||
| 81 | enum class Index : u64 { | 81 | enum class Index : u64 { |
| 82 | PointSize = 6, | ||
| 82 | Position = 7, | 83 | Position = 7, |
| 83 | Attribute_0 = 8, | 84 | Attribute_0 = 8, |
| 84 | Attribute_31 = 39, | 85 | Attribute_31 = 39, |
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index fe4d1bd83..81ffb24e4 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <set> | 6 | #include <set> |
| 7 | #include <string> | 7 | #include <string> |
| 8 | #include <string_view> | 8 | #include <string_view> |
| 9 | #include <unordered_set> | ||
| 9 | 10 | ||
| 10 | #include <boost/optional.hpp> | 11 | #include <boost/optional.hpp> |
| 11 | #include <fmt/format.h> | 12 | #include <fmt/format.h> |
| @@ -276,7 +277,8 @@ public: | |||
| 276 | GLSLRegisterManager(ShaderWriter& shader, ShaderWriter& declarations, | 277 | GLSLRegisterManager(ShaderWriter& shader, ShaderWriter& declarations, |
| 277 | const Maxwell3D::Regs::ShaderStage& stage, const std::string& suffix, | 278 | const Maxwell3D::Regs::ShaderStage& stage, const std::string& suffix, |
| 278 | const Tegra::Shader::Header& header) | 279 | const Tegra::Shader::Header& header) |
| 279 | : shader{shader}, declarations{declarations}, stage{stage}, suffix{suffix}, header{header} { | 280 | : shader{shader}, declarations{declarations}, stage{stage}, suffix{suffix}, header{header}, |
| 281 | fixed_pipeline_output_attributes_used{} { | ||
| 280 | BuildRegisterList(); | 282 | BuildRegisterList(); |
| 281 | BuildInputList(); | 283 | BuildInputList(); |
| 282 | } | 284 | } |
| @@ -480,7 +482,12 @@ public: | |||
| 480 | std::to_string(static_cast<u32>(attribute)) + ']' + | 482 | std::to_string(static_cast<u32>(attribute)) + ']' + |
| 481 | GetSwizzle(elem) + " = " + src + ';'); | 483 | GetSwizzle(elem) + " = " + src + ';'); |
| 482 | } else { | 484 | } else { |
| 483 | shader.AddLine(dest + GetSwizzle(elem) + " = " + src + ';'); | 485 | if (attribute == Attribute::Index::PointSize) { |
| 486 | fixed_pipeline_output_attributes_used.insert(attribute); | ||
| 487 | shader.AddLine(dest + " = " + src + ';'); | ||
| 488 | } else { | ||
| 489 | shader.AddLine(dest + GetSwizzle(elem) + " = " + src + ';'); | ||
| 490 | } | ||
| 484 | } | 491 | } |
| 485 | } | 492 | } |
| 486 | } | 493 | } |
| @@ -524,6 +531,7 @@ public: | |||
| 524 | 531 | ||
| 525 | /// Add declarations. | 532 | /// Add declarations. |
| 526 | void GenerateDeclarations(const std::string& suffix) { | 533 | void GenerateDeclarations(const std::string& suffix) { |
| 534 | GenerateVertex(); | ||
| 527 | GenerateRegisters(suffix); | 535 | GenerateRegisters(suffix); |
| 528 | GenerateInternalFlags(); | 536 | GenerateInternalFlags(); |
| 529 | GenerateInputAttrs(); | 537 | GenerateInputAttrs(); |
| @@ -683,6 +691,20 @@ private: | |||
| 683 | declarations.AddNewLine(); | 691 | declarations.AddNewLine(); |
| 684 | } | 692 | } |
| 685 | 693 | ||
| 694 | void GenerateVertex() { | ||
| 695 | if (stage != Maxwell3D::Regs::ShaderStage::Vertex) | ||
| 696 | return; | ||
| 697 | declarations.AddLine("out gl_PerVertex {"); | ||
| 698 | ++declarations.scope; | ||
| 699 | declarations.AddLine("vec4 gl_Position;"); | ||
| 700 | for (auto& o : fixed_pipeline_output_attributes_used) { | ||
| 701 | if (o == Attribute::Index::PointSize) | ||
| 702 | declarations.AddLine("float gl_PointSize;"); | ||
| 703 | } | ||
| 704 | --declarations.scope; | ||
| 705 | declarations.AddLine("};"); | ||
| 706 | } | ||
| 707 | |||
| 686 | /// Generates code representing a temporary (GPR) register. | 708 | /// Generates code representing a temporary (GPR) register. |
| 687 | std::string GetRegister(const Register& reg, unsigned elem) { | 709 | std::string GetRegister(const Register& reg, unsigned elem) { |
| 688 | if (reg == Register::ZeroIndex) { | 710 | if (reg == Register::ZeroIndex) { |
| @@ -836,6 +858,8 @@ private: | |||
| 836 | /// Generates code representing the declaration name of an output attribute register. | 858 | /// Generates code representing the declaration name of an output attribute register. |
| 837 | std::string GetOutputAttribute(Attribute::Index attribute) { | 859 | std::string GetOutputAttribute(Attribute::Index attribute) { |
| 838 | switch (attribute) { | 860 | switch (attribute) { |
| 861 | case Attribute::Index::PointSize: | ||
| 862 | return "gl_PointSize"; | ||
| 839 | case Attribute::Index::Position: | 863 | case Attribute::Index::Position: |
| 840 | return "position"; | 864 | return "position"; |
| 841 | default: | 865 | default: |
| @@ -870,6 +894,7 @@ private: | |||
| 870 | const Maxwell3D::Regs::ShaderStage& stage; | 894 | const Maxwell3D::Regs::ShaderStage& stage; |
| 871 | const std::string& suffix; | 895 | const std::string& suffix; |
| 872 | const Tegra::Shader::Header& header; | 896 | const Tegra::Shader::Header& header; |
| 897 | std::unordered_set<Attribute::Index> fixed_pipeline_output_attributes_used; | ||
| 873 | }; | 898 | }; |
| 874 | 899 | ||
| 875 | class GLSLGenerator { | 900 | class GLSLGenerator { |
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index e883ffb1d..dfb562706 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp | |||
| @@ -19,9 +19,6 @@ ProgramResult GenerateVertexShader(const ShaderSetup& setup) { | |||
| 19 | out += Decompiler::GetCommonDeclarations(); | 19 | out += Decompiler::GetCommonDeclarations(); |
| 20 | 20 | ||
| 21 | out += R"( | 21 | out += R"( |
| 22 | out gl_PerVertex { | ||
| 23 | vec4 gl_Position; | ||
| 24 | }; | ||
| 25 | 22 | ||
| 26 | layout (location = 0) out vec4 position; | 23 | layout (location = 0) out vec4 position; |
| 27 | 24 | ||
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index f1b40e7f5..da7989db9 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -142,7 +142,6 @@ void SwizzledData(u8* swizzled_data, u8* unswizzled_data, const bool unswizzle, | |||
| 142 | const u32 blocks_on_x = div_ceil(width, block_x_elements); | 142 | const u32 blocks_on_x = div_ceil(width, block_x_elements); |
| 143 | const u32 blocks_on_y = div_ceil(height, block_y_elements); | 143 | const u32 blocks_on_y = div_ceil(height, block_y_elements); |
| 144 | const u32 blocks_on_z = div_ceil(depth, block_z_elements); | 144 | const u32 blocks_on_z = div_ceil(depth, block_z_elements); |
| 145 | const u32 blocks = blocks_on_x * blocks_on_y * blocks_on_z; | ||
| 146 | const u32 gob_size = gob_x_bytes * gob_elements_y * gob_elements_z; | 145 | const u32 gob_size = gob_x_bytes * gob_elements_y * gob_elements_z; |
| 147 | const u32 xy_block_size = gob_size * block_height; | 146 | const u32 xy_block_size = gob_size * block_height; |
| 148 | const u32 block_size = xy_block_size * block_depth; | 147 | const u32 block_size = xy_block_size * block_depth; |
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index e8ab23326..39eef8858 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include "common/microprofile.h" | 9 | #include "common/microprofile.h" |
| 10 | #include "common/scm_rev.h" | 10 | #include "common/scm_rev.h" |
| 11 | #include "common/string_util.h" | ||
| 12 | #include "core/core.h" | 11 | #include "core/core.h" |
| 13 | #include "core/frontend/framebuffer_layout.h" | 12 | #include "core/frontend/framebuffer_layout.h" |
| 14 | #include "core/settings.h" | 13 | #include "core/settings.h" |
| @@ -107,9 +106,8 @@ private: | |||
| 107 | GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) | 106 | GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) |
| 108 | : QWidget(parent), child(nullptr), emu_thread(emu_thread) { | 107 | : QWidget(parent), child(nullptr), emu_thread(emu_thread) { |
| 109 | 108 | ||
| 110 | std::string window_title = fmt::format("yuzu {} | {}-{}", Common::g_build_name, | 109 | setWindowTitle(QStringLiteral("yuzu %1 | %2-%3") |
| 111 | Common::g_scm_branch, Common::g_scm_desc); | 110 | .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); |
| 112 | setWindowTitle(QString::fromStdString(window_title)); | ||
| 113 | setAttribute(Qt::WA_AcceptTouchEvents); | 111 | setAttribute(Qt::WA_AcceptTouchEvents); |
| 114 | 112 | ||
| 115 | InputCommon::Init(); | 113 | InputCommon::Init(); |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 1fe9a7edd..d4fd60a73 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -13,11 +13,16 @@ Config::Config() { | |||
| 13 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 13 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| 14 | qt_config_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "qt-config.ini"; | 14 | qt_config_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "qt-config.ini"; |
| 15 | FileUtil::CreateFullPath(qt_config_loc); | 15 | FileUtil::CreateFullPath(qt_config_loc); |
| 16 | qt_config = new QSettings(QString::fromStdString(qt_config_loc), QSettings::IniFormat); | 16 | qt_config = |
| 17 | std::make_unique<QSettings>(QString::fromStdString(qt_config_loc), QSettings::IniFormat); | ||
| 17 | 18 | ||
| 18 | Reload(); | 19 | Reload(); |
| 19 | } | 20 | } |
| 20 | 21 | ||
| 22 | Config::~Config() { | ||
| 23 | Save(); | ||
| 24 | } | ||
| 25 | |||
| 21 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { | 26 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { |
| 22 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, | 27 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, |
| 23 | Qt::Key_W, Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, | 28 | Qt::Key_W, Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, |
| @@ -342,9 +347,3 @@ void Config::Reload() { | |||
| 342 | void Config::Save() { | 347 | void Config::Save() { |
| 343 | SaveValues(); | 348 | SaveValues(); |
| 344 | } | 349 | } |
| 345 | |||
| 346 | Config::~Config() { | ||
| 347 | Save(); | ||
| 348 | |||
| 349 | delete qt_config; | ||
| 350 | } | ||
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index cbf745ea2..9c99c1b75 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <memory> | ||
| 8 | #include <string> | 9 | #include <string> |
| 9 | #include <QVariant> | 10 | #include <QVariant> |
| 10 | #include "core/settings.h" | 11 | #include "core/settings.h" |
| @@ -12,12 +13,6 @@ | |||
| 12 | class QSettings; | 13 | class QSettings; |
| 13 | 14 | ||
| 14 | class Config { | 15 | class Config { |
| 15 | QSettings* qt_config; | ||
| 16 | std::string qt_config_loc; | ||
| 17 | |||
| 18 | void ReadValues(); | ||
| 19 | void SaveValues(); | ||
| 20 | |||
| 21 | public: | 16 | public: |
| 22 | Config(); | 17 | Config(); |
| 23 | ~Config(); | 18 | ~Config(); |
| @@ -27,4 +22,11 @@ public: | |||
| 27 | 22 | ||
| 28 | static const std::array<int, Settings::NativeButton::NumButtons> default_buttons; | 23 | static const std::array<int, Settings::NativeButton::NumButtons> default_buttons; |
| 29 | static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> default_analogs; | 24 | static const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> default_analogs; |
| 25 | |||
| 26 | private: | ||
| 27 | void ReadValues(); | ||
| 28 | void SaveValues(); | ||
| 29 | |||
| 30 | std::unique_ptr<QSettings> qt_config; | ||
| 31 | std::string qt_config_loc; | ||
| 30 | }; | 32 | }; |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index 83cc49dfc..0bc307e99 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -153,7 +153,7 @@ void ConfigureSystem::UpdateCurrentUser() { | |||
| 153 | ui->pm_add->setEnabled(profile_manager->GetUserCount() < Service::Account::MAX_USERS); | 153 | ui->pm_add->setEnabled(profile_manager->GetUserCount() < Service::Account::MAX_USERS); |
| 154 | 154 | ||
| 155 | const auto& current_user = profile_manager->GetUser(Settings::values.current_user); | 155 | const auto& current_user = profile_manager->GetUser(Settings::values.current_user); |
| 156 | ASSERT(current_user != boost::none); | 156 | ASSERT(current_user != std::nullopt); |
| 157 | const auto username = GetAccountUsername(*current_user); | 157 | const auto username = GetAccountUsername(*current_user); |
| 158 | 158 | ||
| 159 | scene->clear(); | 159 | scene->clear(); |
| @@ -252,7 +252,7 @@ void ConfigureSystem::AddUser() { | |||
| 252 | void ConfigureSystem::RenameUser() { | 252 | void ConfigureSystem::RenameUser() { |
| 253 | const auto user = tree_view->currentIndex().row(); | 253 | const auto user = tree_view->currentIndex().row(); |
| 254 | const auto uuid = profile_manager->GetUser(user); | 254 | const auto uuid = profile_manager->GetUser(user); |
| 255 | ASSERT(uuid != boost::none); | 255 | ASSERT(uuid != std::nullopt); |
| 256 | const auto username = GetAccountUsername(*uuid); | 256 | const auto username = GetAccountUsername(*uuid); |
| 257 | 257 | ||
| 258 | Service::Account::ProfileBase profile; | 258 | Service::Account::ProfileBase profile; |
| @@ -292,7 +292,7 @@ void ConfigureSystem::RenameUser() { | |||
| 292 | void ConfigureSystem::DeleteUser() { | 292 | void ConfigureSystem::DeleteUser() { |
| 293 | const auto index = tree_view->currentIndex().row(); | 293 | const auto index = tree_view->currentIndex().row(); |
| 294 | const auto uuid = profile_manager->GetUser(index); | 294 | const auto uuid = profile_manager->GetUser(index); |
| 295 | ASSERT(uuid != boost::none); | 295 | ASSERT(uuid != std::nullopt); |
| 296 | const auto username = GetAccountUsername(*uuid); | 296 | const auto username = GetAccountUsername(*uuid); |
| 297 | 297 | ||
| 298 | const auto confirm = | 298 | const auto confirm = |
| @@ -320,7 +320,7 @@ void ConfigureSystem::DeleteUser() { | |||
| 320 | void ConfigureSystem::SetUserImage() { | 320 | void ConfigureSystem::SetUserImage() { |
| 321 | const auto index = tree_view->currentIndex().row(); | 321 | const auto index = tree_view->currentIndex().row(); |
| 322 | const auto uuid = profile_manager->GetUser(index); | 322 | const auto uuid = profile_manager->GetUser(index); |
| 323 | ASSERT(uuid != boost::none); | 323 | ASSERT(uuid != std::nullopt); |
| 324 | const auto username = GetAccountUsername(*uuid); | 324 | const auto username = GetAccountUsername(*uuid); |
| 325 | 325 | ||
| 326 | const auto file = QFileDialog::getOpenFileName(this, tr("Select User Image"), QString(), | 326 | const auto file = QFileDialog::getOpenFileName(this, tr("Select User Image"), QString(), |
diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp index b5c88f944..67ed0ba6d 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp +++ b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <map> | ||
| 6 | #include <QLabel> | 5 | #include <QLabel> |
| 7 | #include <QMetaType> | 6 | #include <QMetaType> |
| 8 | #include <QPushButton> | 7 | #include <QPushButton> |
| @@ -32,21 +31,8 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const { | |||
| 32 | switch (role) { | 31 | switch (role) { |
| 33 | case Qt::DisplayRole: { | 32 | case Qt::DisplayRole: { |
| 34 | if (index.column() == 0) { | 33 | if (index.column() == 0) { |
| 35 | static const std::map<Tegra::DebugContext::Event, QString> map = { | 34 | return DebugContextEventToString(event); |
| 36 | {Tegra::DebugContext::Event::MaxwellCommandLoaded, tr("Maxwell command loaded")}, | ||
| 37 | {Tegra::DebugContext::Event::MaxwellCommandProcessed, | ||
| 38 | tr("Maxwell command processed")}, | ||
| 39 | {Tegra::DebugContext::Event::IncomingPrimitiveBatch, | ||
| 40 | tr("Incoming primitive batch")}, | ||
| 41 | {Tegra::DebugContext::Event::FinishedPrimitiveBatch, | ||
| 42 | tr("Finished primitive batch")}, | ||
| 43 | }; | ||
| 44 | |||
| 45 | DEBUG_ASSERT(map.size() == | ||
| 46 | static_cast<std::size_t>(Tegra::DebugContext::Event::NumEvents)); | ||
| 47 | return (map.find(event) != map.end()) ? map.at(event) : QString(); | ||
| 48 | } | 35 | } |
| 49 | |||
| 50 | break; | 36 | break; |
| 51 | } | 37 | } |
| 52 | 38 | ||
| @@ -128,6 +114,23 @@ void BreakPointModel::OnResumed() { | |||
| 128 | active_breakpoint = context->active_breakpoint; | 114 | active_breakpoint = context->active_breakpoint; |
| 129 | } | 115 | } |
| 130 | 116 | ||
| 117 | QString BreakPointModel::DebugContextEventToString(Tegra::DebugContext::Event event) { | ||
| 118 | switch (event) { | ||
| 119 | case Tegra::DebugContext::Event::MaxwellCommandLoaded: | ||
| 120 | return tr("Maxwell command loaded"); | ||
| 121 | case Tegra::DebugContext::Event::MaxwellCommandProcessed: | ||
| 122 | return tr("Maxwell command processed"); | ||
| 123 | case Tegra::DebugContext::Event::IncomingPrimitiveBatch: | ||
| 124 | return tr("Incoming primitive batch"); | ||
| 125 | case Tegra::DebugContext::Event::FinishedPrimitiveBatch: | ||
| 126 | return tr("Finished primitive batch"); | ||
| 127 | case Tegra::DebugContext::Event::NumEvents: | ||
| 128 | break; | ||
| 129 | } | ||
| 130 | |||
| 131 | return tr("Unknown debug context event"); | ||
| 132 | } | ||
| 133 | |||
| 131 | GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( | 134 | GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( |
| 132 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) | 135 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) |
| 133 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( | 136 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( |
diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h b/src/yuzu/debugger/graphics/graphics_breakpoints_p.h index 7112b87e6..fb488e38f 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h +++ b/src/yuzu/debugger/graphics/graphics_breakpoints_p.h | |||
| @@ -29,6 +29,8 @@ public: | |||
| 29 | void OnResumed(); | 29 | void OnResumed(); |
| 30 | 30 | ||
| 31 | private: | 31 | private: |
| 32 | static QString DebugContextEventToString(Tegra::DebugContext::Event event); | ||
| 33 | |||
| 32 | std::weak_ptr<Tegra::DebugContext> context_weak; | 34 | std::weak_ptr<Tegra::DebugContext> context_weak; |
| 33 | bool at_breakpoint; | 35 | bool at_breakpoint; |
| 34 | Tegra::DebugContext::Event active_breakpoint; | 36 | Tegra::DebugContext::Event active_breakpoint; |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 67890455a..a5a4aa432 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <fmt/format.h> | 16 | #include <fmt/format.h> |
| 17 | #include "common/common_paths.h" | 17 | #include "common/common_paths.h" |
| 18 | #include "common/common_types.h" | 18 | #include "common/common_types.h" |
| 19 | #include "common/file_util.h" | ||
| 20 | #include "common/logging/log.h" | 19 | #include "common/logging/log.h" |
| 21 | #include "core/file_sys/patch_manager.h" | 20 | #include "core/file_sys/patch_manager.h" |
| 22 | #include "yuzu/compatibility_list.h" | 21 | #include "yuzu/compatibility_list.h" |
| @@ -217,11 +216,11 @@ GameList::GameList(FileSys::VirtualFilesystem vfs, GMainWindow* parent) | |||
| 217 | tree_view->setContextMenuPolicy(Qt::CustomContextMenu); | 216 | tree_view->setContextMenuPolicy(Qt::CustomContextMenu); |
| 218 | 217 | ||
| 219 | item_model->insertColumns(0, COLUMN_COUNT); | 218 | item_model->insertColumns(0, COLUMN_COUNT); |
| 220 | item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, "Name"); | 219 | item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, tr("Name")); |
| 221 | item_model->setHeaderData(COLUMN_COMPATIBILITY, Qt::Horizontal, "Compatibility"); | 220 | item_model->setHeaderData(COLUMN_COMPATIBILITY, Qt::Horizontal, tr("Compatibility")); |
| 222 | item_model->setHeaderData(COLUMN_ADD_ONS, Qt::Horizontal, "Add-ons"); | 221 | item_model->setHeaderData(COLUMN_ADD_ONS, Qt::Horizontal, tr("Add-ons")); |
| 223 | item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, "File type"); | 222 | item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, tr("File type")); |
| 224 | item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, "Size"); | 223 | item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, tr("Size")); |
| 225 | 224 | ||
| 226 | connect(tree_view, &QTreeView::activated, this, &GameList::ValidateEntry); | 225 | connect(tree_view, &QTreeView::activated, this, &GameList::ValidateEntry); |
| 227 | connect(tree_view, &QTreeView::customContextMenuRequested, this, &GameList::PopupContextMenu); | 226 | connect(tree_view, &QTreeView::customContextMenuRequested, this, &GameList::PopupContextMenu); |
| @@ -387,9 +386,9 @@ void GameList::LoadCompatibilityList() { | |||
| 387 | } | 386 | } |
| 388 | 387 | ||
| 389 | void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { | 388 | void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { |
| 390 | if (!FileUtil::Exists(dir_path.toStdString()) || | 389 | const QFileInfo dir_info{dir_path}; |
| 391 | !FileUtil::IsDirectory(dir_path.toStdString())) { | 390 | if (!dir_info.exists() || !dir_info.isDir()) { |
| 392 | LOG_ERROR(Frontend, "Could not find game list folder at {}", dir_path.toLocal8Bit().data()); | 391 | LOG_ERROR(Frontend, "Could not find game list folder at {}", dir_path.toStdString()); |
| 393 | search_field->setFilterResult(0, 0); | 392 | search_field->setFilterResult(0, 0); |
| 394 | return; | 393 | return; |
| 395 | } | 394 | } |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 47f494841..55508b1e1 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -785,7 +785,7 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target | |||
| 785 | ASSERT(index != -1 && index < 8); | 785 | ASSERT(index != -1 && index < 8); |
| 786 | 786 | ||
| 787 | const auto user_id = manager.GetUser(index); | 787 | const auto user_id = manager.GetUser(index); |
| 788 | ASSERT(user_id != boost::none); | 788 | ASSERT(user_id != std::nullopt); |
| 789 | path = nand_dir + FileSys::SaveDataFactory::GetFullPath(FileSys::SaveDataSpaceId::NandUser, | 789 | path = nand_dir + FileSys::SaveDataFactory::GetFullPath(FileSys::SaveDataSpaceId::NandUser, |
| 790 | FileSys::SaveDataType::SaveData, | 790 | FileSys::SaveDataType::SaveData, |
| 791 | program_id, user_id->uuid, 0); | 791 | program_id, user_id->uuid, 0); |