summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2022-02-05 12:35:39 -0500
committerGravatar Morph2022-02-05 13:56:21 -0500
commit25db62ce1534cbd8b93b4284869229e4bd7de54d (patch)
treedd74d3fc6ba14a0de5e88778cad5b5c65fcba248 /src
parentprofile: Migrate to the new UUID implementation (diff)
downloadyuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.gz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.tar.xz
yuzu-25db62ce1534cbd8b93b4284869229e4bd7de54d.zip
general: Rename NewUUID to UUID, and remove the previous UUID impl
This completes the removal of the old UUID implementation.
Diffstat (limited to 'src')
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/common/input.h8
-rw-r--r--src/common/new_uuid.cpp188
-rw-r--r--src/common/new_uuid.h141
-rw-r--r--src/common/uuid.cpp185
-rw-r--r--src/common/uuid.h166
-rw-r--r--src/core/frontend/applets/profile_select.cpp4
-rw-r--r--src/core/frontend/applets/profile_select.h7
-rw-r--r--src/core/hid/emulated_controller.cpp14
-rw-r--r--src/core/hid/emulated_controller.h6
-rw-r--r--src/core/hid/hid_types.h2
-rw-r--r--src/core/hle/service/acc/acc.cpp57
-rw-r--r--src/core/hle/service/acc/acc.h4
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp40
-rw-r--r--src/core/hle/service/acc/profile_manager.h36
-rw-r--r--src/core/hle/service/am/am.cpp2
-rw-r--r--src/core/hle/service/am/applets/applet_profile_select.cpp5
-rw-r--r--src/core/hle/service/am/applets/applet_profile_select.h6
-rw-r--r--src/core/hle/service/friend/friend.cpp12
-rw-r--r--src/core/hle/service/mii/mii_manager.cpp11
-rw-r--r--src/core/hle/service/mii/mii_manager.h10
-rw-r--r--src/core/hle/service/ns/pdm_qry.cpp4
-rw-r--r--src/core/hle/service/time/clock_types.h8
-rw-r--r--src/core/hle/service/time/steady_clock_core.h8
-rw-r--r--src/core/hle/service/time/time_manager.cpp4
-rw-r--r--src/core/hle/service/time/time_sharedmemory.cpp2
-rw-r--r--src/core/hle/service/time/time_sharedmemory.h4
-rw-r--r--src/input_common/drivers/gc_adapter.cpp2
-rw-r--r--src/input_common/drivers/keyboard.cpp6
-rw-r--r--src/input_common/drivers/mouse.cpp2
-rw-r--r--src/input_common/drivers/sdl_driver.cpp2
-rw-r--r--src/input_common/drivers/tas_input.cpp4
-rw-r--r--src/input_common/drivers/touch_screen.cpp2
-rw-r--r--src/input_common/drivers/udp_client.cpp4
-rw-r--r--src/input_common/drivers/udp_client.h4
-rw-r--r--src/input_common/input_engine.h4
-rw-r--r--src/input_common/input_poller.cpp18
-rw-r--r--src/yuzu/applets/qt_profile_select.cpp10
-rw-r--r--src/yuzu/applets/qt_profile_select.h7
-rw-r--r--src/yuzu/configuration/configure_profile_manager.cpp10
-rw-r--r--src/yuzu/main.h2
41 files changed, 415 insertions, 598 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 3dd460191..adf70eb8b 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -99,8 +99,6 @@ add_library(common STATIC
99 microprofile.cpp 99 microprofile.cpp
100 microprofile.h 100 microprofile.h
101 microprofileui.h 101 microprofileui.h
102 new_uuid.cpp
103 new_uuid.h
104 nvidia_flags.cpp 102 nvidia_flags.cpp
105 nvidia_flags.h 103 nvidia_flags.h
106 page_table.cpp 104 page_table.cpp
diff --git a/src/common/input.h b/src/common/input.h
index 95d30497d..54fcb24b0 100644
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -10,8 +10,8 @@
10#include <unordered_map> 10#include <unordered_map>
11#include <utility> 11#include <utility>
12#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/new_uuid.h"
14#include "common/param_package.h" 13#include "common/param_package.h"
14#include "common/uuid.h"
15 15
16namespace Common::Input { 16namespace Common::Input {
17 17
@@ -97,7 +97,7 @@ struct AnalogStatus {
97 97
98// Button data 98// Button data
99struct ButtonStatus { 99struct ButtonStatus {
100 Common::NewUUID uuid{}; 100 Common::UUID uuid{};
101 bool value{}; 101 bool value{};
102 bool inverted{}; 102 bool inverted{};
103 bool toggle{}; 103 bool toggle{};
@@ -109,7 +109,7 @@ using BatteryStatus = BatteryLevel;
109 109
110// Analog and digital joystick data 110// Analog and digital joystick data
111struct StickStatus { 111struct StickStatus {
112 Common::NewUUID uuid{}; 112 Common::UUID uuid{};
113 AnalogStatus x{}; 113 AnalogStatus x{};
114 AnalogStatus y{}; 114 AnalogStatus y{};
115 bool left{}; 115 bool left{};
@@ -120,7 +120,7 @@ struct StickStatus {
120 120
121// Analog and digital trigger data 121// Analog and digital trigger data
122struct TriggerStatus { 122struct TriggerStatus {
123 Common::NewUUID uuid{}; 123 Common::UUID uuid{};
124 AnalogStatus analog{}; 124 AnalogStatus analog{};
125 ButtonStatus pressed{}; 125 ButtonStatus pressed{};
126}; 126};
diff --git a/src/common/new_uuid.cpp b/src/common/new_uuid.cpp
deleted file mode 100644
index f2f0077ae..000000000
--- a/src/common/new_uuid.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
1// Copyright 2022 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <bit>
6#include <random>
7
8#include <fmt/format.h>
9
10#include "common/assert.h"
11#include "common/new_uuid.h"
12#include "common/tiny_mt.h"
13
14namespace Common {
15
16namespace {
17
18constexpr size_t RawStringSize = sizeof(NewUUID) * 2;
19constexpr size_t FormattedStringSize = RawStringSize + 4;
20
21u8 HexCharToByte(char c) {
22 if (c >= '0' && c <= '9') {
23 return static_cast<u8>(c - '0');
24 }
25 if (c >= 'a' && c <= 'f') {
26 return static_cast<u8>(c - 'a' + 10);
27 }
28 if (c >= 'A' && c <= 'F') {
29 return static_cast<u8>(c - 'A' + 10);
30 }
31 ASSERT_MSG(false, "{} is not a hexadecimal digit!", c);
32 return u8{0};
33}
34
35std::array<u8, 0x10> ConstructFromRawString(std::string_view raw_string) {
36 std::array<u8, 0x10> uuid;
37
38 for (size_t i = 0; i < RawStringSize; i += 2) {
39 uuid[i / 2] =
40 static_cast<u8>((HexCharToByte(raw_string[i]) << 4) | HexCharToByte(raw_string[i + 1]));
41 }
42
43 return uuid;
44}
45
46std::array<u8, 0x10> ConstructFromFormattedString(std::string_view formatted_string) {
47 std::array<u8, 0x10> uuid;
48
49 size_t i = 0;
50
51 // Process the first 8 characters.
52 const auto* str = formatted_string.data();
53
54 for (; i < 4; ++i) {
55 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
56 uuid[i] |= HexCharToByte(*(str++));
57 }
58
59 // Process the next 4 characters.
60 ++str;
61
62 for (; i < 6; ++i) {
63 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
64 uuid[i] |= HexCharToByte(*(str++));
65 }
66
67 // Process the next 4 characters.
68 ++str;
69
70 for (; i < 8; ++i) {
71 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
72 uuid[i] |= HexCharToByte(*(str++));
73 }
74
75 // Process the next 4 characters.
76 ++str;
77
78 for (; i < 10; ++i) {
79 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
80 uuid[i] |= HexCharToByte(*(str++));
81 }
82
83 // Process the last 12 characters.
84 ++str;
85
86 for (; i < 16; ++i) {
87 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
88 uuid[i] |= HexCharToByte(*(str++));
89 }
90
91 return uuid;
92}
93
94std::array<u8, 0x10> ConstructUUID(std::string_view uuid_string) {
95 const auto length = uuid_string.length();
96
97 if (length == 0) {
98 return {};
99 }
100
101 // Check if the input string contains 32 hexadecimal characters.
102 if (length == RawStringSize) {
103 return ConstructFromRawString(uuid_string);
104 }
105
106 // Check if the input string has the length of a RFC 4122 formatted UUID string.
107 if (length == FormattedStringSize) {
108 return ConstructFromFormattedString(uuid_string);
109 }
110
111 ASSERT_MSG(false, "UUID string has an invalid length of {} characters!", length);
112
113 return {};
114}
115
116} // Anonymous namespace
117
118NewUUID::NewUUID(std::string_view uuid_string) : uuid{ConstructUUID(uuid_string)} {}
119
120std::string NewUUID::RawString() const {
121 return fmt::format("{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}"
122 "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
123 uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
124 uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],
125 uuid[15]);
126}
127
128std::string NewUUID::FormattedString() const {
129 return fmt::format("{:02x}{:02x}{:02x}{:02x}"
130 "-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-"
131 "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
132 uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
133 uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],
134 uuid[15]);
135}
136
137size_t NewUUID::Hash() const noexcept {
138 u64 hash;
139 u64 temp;
140
141 std::memcpy(&hash, uuid.data(), sizeof(u64));
142 std::memcpy(&temp, uuid.data() + 8, sizeof(u64));
143
144 return hash ^ std::rotl(temp, 1);
145}
146
147u128 NewUUID::AsU128() const {
148 u128 uuid_old;
149 std::memcpy(&uuid_old, uuid.data(), sizeof(NewUUID));
150 return uuid_old;
151}
152
153NewUUID NewUUID::MakeRandom() {
154 std::random_device device;
155
156 return MakeRandomWithSeed(device());
157}
158
159NewUUID NewUUID::MakeRandomWithSeed(u32 seed) {
160 // Create and initialize our RNG.
161 TinyMT rng;
162 rng.Initialize(seed);
163
164 NewUUID uuid;
165
166 // Populate the UUID with random bytes.
167 rng.GenerateRandomBytes(uuid.uuid.data(), sizeof(NewUUID));
168
169 return uuid;
170}
171
172NewUUID NewUUID::MakeRandomRFC4122V4() {
173 auto uuid = MakeRandom();
174
175 // According to Proposed Standard RFC 4122 Section 4.4, we must:
176
177 // 1. Set the two most significant bits (bits 6 and 7) of the
178 // clock_seq_hi_and_reserved to zero and one, respectively.
179 uuid.uuid[8] = 0x80 | (uuid.uuid[8] & 0x3F);
180
181 // 2. Set the four most significant bits (bits 12 through 15) of the
182 // time_hi_and_version field to the 4-bit version number from Section 4.1.3.
183 uuid.uuid[6] = 0x40 | (uuid.uuid[6] & 0xF);
184
185 return uuid;
186}
187
188} // namespace Common
diff --git a/src/common/new_uuid.h b/src/common/new_uuid.h
deleted file mode 100644
index 44665ad5a..000000000
--- a/src/common/new_uuid.h
+++ /dev/null
@@ -1,141 +0,0 @@
1// Copyright 2022 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <array>
8#include <functional>
9#include <string>
10#include <string_view>
11
12#include "common/common_types.h"
13
14namespace Common {
15
16struct NewUUID {
17 std::array<u8, 0x10> uuid{};
18
19 /// Constructs an invalid UUID.
20 constexpr NewUUID() = default;
21
22 /// Constructs a UUID from a reference to a 128 bit array.
23 constexpr explicit NewUUID(const std::array<u8, 16>& uuid_) : uuid{uuid_} {}
24
25 /**
26 * Constructs a UUID from either:
27 * 1. A 32 hexadecimal character string representing the bytes of the UUID
28 * 2. A RFC 4122 formatted UUID string, in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
29 *
30 * The input string may contain uppercase or lowercase characters, but they must:
31 * 1. Contain valid hexadecimal characters (0-9, a-f, A-F)
32 * 2. Not contain the "0x" hexadecimal prefix
33 *
34 * Should the input string not meet the above requirements,
35 * an assert will be triggered and an invalid UUID is set instead.
36 */
37 explicit NewUUID(std::string_view uuid_string);
38
39 ~NewUUID() = default;
40
41 constexpr NewUUID(const NewUUID&) noexcept = default;
42 constexpr NewUUID(NewUUID&&) noexcept = default;
43
44 constexpr NewUUID& operator=(const NewUUID&) noexcept = default;
45 constexpr NewUUID& operator=(NewUUID&&) noexcept = default;
46
47 /**
48 * Returns whether the stored UUID is valid or not.
49 *
50 * @returns True if the stored UUID is valid, false otherwise.
51 */
52 constexpr bool IsValid() const {
53 return uuid != std::array<u8, 0x10>{};
54 }
55
56 /**
57 * Returns whether the stored UUID is invalid or not.
58 *
59 * @returns True if the stored UUID is invalid, false otherwise.
60 */
61 constexpr bool IsInvalid() const {
62 return !IsValid();
63 }
64
65 /**
66 * Returns a 32 hexadecimal character string representing the bytes of the UUID.
67 *
68 * @returns A 32 hexadecimal character string of the UUID.
69 */
70 std::string RawString() const;
71
72 /**
73 * Returns a RFC 4122 formatted UUID string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
74 *
75 * @returns A RFC 4122 formatted UUID string.
76 */
77 std::string FormattedString() const;
78
79 /**
80 * Returns a 64-bit hash of the UUID for use in hash table data structures.
81 *
82 * @returns A 64-bit hash of the UUID.
83 */
84 size_t Hash() const noexcept;
85
86 /// DO NOT USE. Copies the contents of the UUID into a u128.
87 u128 AsU128() const;
88
89 /**
90 * Creates a default UUID "yuzu Default UID".
91 *
92 * @returns A UUID with its bytes set to the ASCII values of "yuzu Default UID".
93 */
94 static constexpr NewUUID MakeDefault() {
95 return NewUUID{
96 {'y', 'u', 'z', 'u', ' ', 'D', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'U', 'I', 'D'},
97 };
98 }
99
100 /**
101 * Creates a random UUID.
102 *
103 * @returns A random UUID.
104 */
105 static NewUUID MakeRandom();
106
107 /**
108 * Creates a random UUID with a seed.
109 *
110 * @param seed A seed to initialize the Mersenne-Twister RNG
111 *
112 * @returns A random UUID.
113 */
114 static NewUUID MakeRandomWithSeed(u32 seed);
115
116 /**
117 * Creates a random UUID. The generated UUID is RFC 4122 Version 4 compliant.
118 *
119 * @returns A random UUID that is RFC 4122 Version 4 compliant.
120 */
121 static NewUUID MakeRandomRFC4122V4();
122
123 friend constexpr bool operator==(const NewUUID& lhs, const NewUUID& rhs) = default;
124};
125static_assert(sizeof(NewUUID) == 0x10, "UUID has incorrect size.");
126
127/// An invalid UUID. This UUID has all its bytes set to 0.
128constexpr NewUUID InvalidUUID = {};
129
130} // namespace Common
131
132namespace std {
133
134template <>
135struct hash<Common::NewUUID> {
136 size_t operator()(const Common::NewUUID& uuid) const noexcept {
137 return uuid.Hash();
138 }
139};
140
141} // namespace std
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp
index d7435a6e9..10a1b86e0 100644
--- a/src/common/uuid.cpp
+++ b/src/common/uuid.cpp
@@ -1,21 +1,22 @@
1// Copyright 2018 yuzu Emulator Project 1// Copyright 2022 yuzu Emulator Project
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 <bit>
5#include <random> 6#include <random>
6 7
7#include <fmt/format.h> 8#include <fmt/format.h>
8 9
9#include "common/assert.h" 10#include "common/assert.h"
11#include "common/tiny_mt.h"
10#include "common/uuid.h" 12#include "common/uuid.h"
11 13
12namespace Common { 14namespace Common {
13 15
14namespace { 16namespace {
15 17
16bool IsHexDigit(char c) { 18constexpr size_t RawStringSize = sizeof(UUID) * 2;
17 return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); 19constexpr size_t FormattedStringSize = RawStringSize + 4;
18}
19 20
20u8 HexCharToByte(char c) { 21u8 HexCharToByte(char c) {
21 if (c >= '0' && c <= '9') { 22 if (c >= '0' && c <= '9') {
@@ -31,57 +32,157 @@ u8 HexCharToByte(char c) {
31 return u8{0}; 32 return u8{0};
32} 33}
33 34
34} // Anonymous namespace 35std::array<u8, 0x10> ConstructFromRawString(std::string_view raw_string) {
36 std::array<u8, 0x10> uuid;
37
38 for (size_t i = 0; i < RawStringSize; i += 2) {
39 uuid[i / 2] =
40 static_cast<u8>((HexCharToByte(raw_string[i]) << 4) | HexCharToByte(raw_string[i + 1]));
41 }
42
43 return uuid;
44}
45
46std::array<u8, 0x10> ConstructFromFormattedString(std::string_view formatted_string) {
47 std::array<u8, 0x10> uuid;
35 48
36u128 HexStringToU128(std::string_view hex_string) { 49 size_t i = 0;
37 const size_t length = hex_string.length();
38 50
39 // Detect "0x" prefix. 51 // Process the first 8 characters.
40 const bool has_0x_prefix = length > 2 && hex_string[0] == '0' && hex_string[1] == 'x'; 52 const auto* str = formatted_string.data();
41 const size_t offset = has_0x_prefix ? 2 : 0;
42 53
43 // Check length. 54 for (; i < 4; ++i) {
44 if (length > 32 + offset) { 55 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
45 ASSERT_MSG(false, "hex_string has more than 32 hexadecimal characters!"); 56 uuid[i] |= HexCharToByte(*(str++));
46 return INVALID_UUID;
47 } 57 }
48 58
49 u64 lo = 0; 59 // Process the next 4 characters.
50 u64 hi = 0; 60 ++str;
51 for (size_t i = 0; i < length - offset; ++i) { 61
52 const char c = hex_string[length - 1 - i]; 62 for (; i < 6; ++i) {
53 if (!IsHexDigit(c)) { 63 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
54 ASSERT_MSG(false, "{} is not a hexadecimal digit!", c); 64 uuid[i] |= HexCharToByte(*(str++));
55 return INVALID_UUID; 65 }
56 } 66
57 if (i < 16) { 67 // Process the next 4 characters.
58 lo |= u64{HexCharToByte(c)} << (i * 4); 68 ++str;
59 } 69
60 if (i >= 16) { 70 for (; i < 8; ++i) {
61 hi |= u64{HexCharToByte(c)} << ((i - 16) * 4); 71 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
62 } 72 uuid[i] |= HexCharToByte(*(str++));
63 } 73 }
64 return u128{lo, hi}; 74
75 // Process the next 4 characters.
76 ++str;
77
78 for (; i < 10; ++i) {
79 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
80 uuid[i] |= HexCharToByte(*(str++));
81 }
82
83 // Process the last 12 characters.
84 ++str;
85
86 for (; i < 16; ++i) {
87 uuid[i] = static_cast<u8>((HexCharToByte(*(str++)) << 4));
88 uuid[i] |= HexCharToByte(*(str++));
89 }
90
91 return uuid;
65} 92}
66 93
67UUID UUID::Generate() { 94std::array<u8, 0x10> ConstructUUID(std::string_view uuid_string) {
95 const auto length = uuid_string.length();
96
97 if (length == 0) {
98 return {};
99 }
100
101 // Check if the input string contains 32 hexadecimal characters.
102 if (length == RawStringSize) {
103 return ConstructFromRawString(uuid_string);
104 }
105
106 // Check if the input string has the length of a RFC 4122 formatted UUID string.
107 if (length == FormattedStringSize) {
108 return ConstructFromFormattedString(uuid_string);
109 }
110
111 ASSERT_MSG(false, "UUID string has an invalid length of {} characters!", length);
112
113 return {};
114}
115
116} // Anonymous namespace
117
118UUID::UUID(std::string_view uuid_string) : uuid{ConstructUUID(uuid_string)} {}
119
120std::string UUID::RawString() const {
121 return fmt::format("{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}"
122 "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
123 uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
124 uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],
125 uuid[15]);
126}
127
128std::string UUID::FormattedString() const {
129 return fmt::format("{:02x}{:02x}{:02x}{:02x}"
130 "-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-"
131 "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
132 uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7],
133 uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],
134 uuid[15]);
135}
136
137size_t UUID::Hash() const noexcept {
138 u64 hash;
139 u64 temp;
140
141 std::memcpy(&hash, uuid.data(), sizeof(u64));
142 std::memcpy(&temp, uuid.data() + 8, sizeof(u64));
143
144 return hash ^ std::rotl(temp, 1);
145}
146
147u128 UUID::AsU128() const {
148 u128 uuid_old;
149 std::memcpy(&uuid_old, uuid.data(), sizeof(UUID));
150 return uuid_old;
151}
152
153UUID UUID::MakeRandom() {
68 std::random_device device; 154 std::random_device device;
69 std::mt19937 gen(device()); 155
70 std::uniform_int_distribution<u64> distribution(1, std::numeric_limits<u64>::max()); 156 return MakeRandomWithSeed(device());
71 return UUID{distribution(gen), distribution(gen)};
72} 157}
73 158
74std::string UUID::Format() const { 159UUID UUID::MakeRandomWithSeed(u32 seed) {
75 return fmt::format("{:016x}{:016x}", uuid[1], uuid[0]); 160 // Create and initialize our RNG.
161 TinyMT rng;
162 rng.Initialize(seed);
163
164 UUID uuid;
165
166 // Populate the UUID with random bytes.
167 rng.GenerateRandomBytes(uuid.uuid.data(), sizeof(UUID));
168
169 return uuid;
76} 170}
77 171
78std::string UUID::FormatSwitch() const { 172UUID UUID::MakeRandomRFC4122V4() {
79 std::array<u8, 16> s{}; 173 auto uuid = MakeRandom();
80 std::memcpy(s.data(), uuid.data(), sizeof(u128)); 174
81 return fmt::format("{:02x}{:02x}{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{:02x}-{:02x}{" 175 // According to Proposed Standard RFC 4122 Section 4.4, we must:
82 ":02x}{:02x}{:02x}{:02x}{:02x}", 176
83 s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], 177 // 1. Set the two most significant bits (bits 6 and 7) of the
84 s[12], s[13], s[14], s[15]); 178 // clock_seq_hi_and_reserved to zero and one, respectively.
179 uuid.uuid[8] = 0x80 | (uuid.uuid[8] & 0x3F);
180
181 // 2. Set the four most significant bits (bits 12 through 15) of the
182 // time_hi_and_version field to the 4-bit version number from Section 4.1.3.
183 uuid.uuid[6] = 0x40 | (uuid.uuid[6] & 0xF);
184
185 return uuid;
85} 186}
86 187
87} // namespace Common 188} // namespace Common
diff --git a/src/common/uuid.h b/src/common/uuid.h
index 8ea01f8da..fe31e64e6 100644
--- a/src/common/uuid.h
+++ b/src/common/uuid.h
@@ -1,9 +1,11 @@
1// Copyright 2018 yuzu Emulator Project 1// Copyright 2022 yuzu Emulator Project
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#pragma once 5#pragma once
6 6
7#include <array>
8#include <functional>
7#include <string> 9#include <string>
8#include <string_view> 10#include <string_view>
9 11
@@ -11,69 +13,119 @@
11 13
12namespace Common { 14namespace Common {
13 15
14constexpr u128 INVALID_UUID{{0, 0}};
15
16/**
17 * Converts a hex string to a 128-bit unsigned integer.
18 *
19 * The hex string can be formatted in lowercase or uppercase, with or without the "0x" prefix.
20 *
21 * This function will assert and return INVALID_UUID under the following conditions:
22 * - If the hex string is more than 32 characters long
23 * - If the hex string contains non-hexadecimal characters
24 *
25 * @param hex_string Hexadecimal string
26 *
27 * @returns A 128-bit unsigned integer if successfully converted, INVALID_UUID otherwise.
28 */
29[[nodiscard]] u128 HexStringToU128(std::string_view hex_string);
30
31struct UUID { 16struct UUID {
32 // UUIDs which are 0 are considered invalid! 17 std::array<u8, 0x10> uuid{};
33 u128 uuid; 18
34 UUID() = default; 19 /// Constructs an invalid UUID.
35 constexpr explicit UUID(const u128& id) : uuid{id} {} 20 constexpr UUID() = default;
36 constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} 21
37 explicit UUID(std::string_view hex_string) { 22 /// Constructs a UUID from a reference to a 128 bit array.
38 uuid = HexStringToU128(hex_string); 23 constexpr explicit UUID(const std::array<u8, 16>& uuid_) : uuid{uuid_} {}
39 } 24
40 25 /**
41 [[nodiscard]] constexpr explicit operator bool() const { 26 * Constructs a UUID from either:
42 return uuid != INVALID_UUID; 27 * 1. A 32 hexadecimal character string representing the bytes of the UUID
43 } 28 * 2. A RFC 4122 formatted UUID string, in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
44 29 *
45 [[nodiscard]] constexpr bool operator==(const UUID& rhs) const { 30 * The input string may contain uppercase or lowercase characters, but they must:
46 return uuid == rhs.uuid; 31 * 1. Contain valid hexadecimal characters (0-9, a-f, A-F)
47 } 32 * 2. Not contain the "0x" hexadecimal prefix
48 33 *
49 [[nodiscard]] constexpr bool operator!=(const UUID& rhs) const { 34 * Should the input string not meet the above requirements,
50 return !operator==(rhs); 35 * an assert will be triggered and an invalid UUID is set instead.
51 } 36 */
52 37 explicit UUID(std::string_view uuid_string);
53 // TODO(ogniK): Properly generate uuids based on RFC-4122 38
54 [[nodiscard]] static UUID Generate(); 39 ~UUID() = default;
55 40
56 // Set the UUID to {0,0} to be considered an invalid user 41 constexpr UUID(const UUID&) noexcept = default;
57 constexpr void Invalidate() { 42 constexpr UUID(UUID&&) noexcept = default;
58 uuid = INVALID_UUID; 43
44 constexpr UUID& operator=(const UUID&) noexcept = default;
45 constexpr UUID& operator=(UUID&&) noexcept = default;
46
47 /**
48 * Returns whether the stored UUID is valid or not.
49 *
50 * @returns True if the stored UUID is valid, false otherwise.
51 */
52 constexpr bool IsValid() const {
53 return uuid != std::array<u8, 0x10>{};
59 } 54 }
60 55
61 [[nodiscard]] constexpr bool IsInvalid() const { 56 /**
62 return uuid == INVALID_UUID; 57 * Returns whether the stored UUID is invalid or not.
63 } 58 *
64 [[nodiscard]] constexpr bool IsValid() const { 59 * @returns True if the stored UUID is invalid, false otherwise.
65 return !IsInvalid(); 60 */
61 constexpr bool IsInvalid() const {
62 return !IsValid();
66 } 63 }
67 64
68 // TODO(ogniK): Properly generate a Nintendo ID 65 /**
69 [[nodiscard]] constexpr u64 GetNintendoID() const { 66 * Returns a 32 hexadecimal character string representing the bytes of the UUID.
70 return uuid[0]; 67 *
68 * @returns A 32 hexadecimal character string of the UUID.
69 */
70 std::string RawString() const;
71
72 /**
73 * Returns a RFC 4122 formatted UUID string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
74 *
75 * @returns A RFC 4122 formatted UUID string.
76 */
77 std::string FormattedString() const;
78
79 /**
80 * Returns a 64-bit hash of the UUID for use in hash table data structures.
81 *
82 * @returns A 64-bit hash of the UUID.
83 */
84 size_t Hash() const noexcept;
85
86 /// DO NOT USE. Copies the contents of the UUID into a u128.
87 u128 AsU128() const;
88
89 /**
90 * Creates a default UUID "yuzu Default UID".
91 *
92 * @returns A UUID with its bytes set to the ASCII values of "yuzu Default UID".
93 */
94 static constexpr UUID MakeDefault() {
95 return UUID{
96 {'y', 'u', 'z', 'u', ' ', 'D', 'e', 'f', 'a', 'u', 'l', 't', ' ', 'U', 'I', 'D'},
97 };
71 } 98 }
72 99
73 [[nodiscard]] std::string Format() const; 100 /**
74 [[nodiscard]] std::string FormatSwitch() const; 101 * Creates a random UUID.
102 *
103 * @returns A random UUID.
104 */
105 static UUID MakeRandom();
106
107 /**
108 * Creates a random UUID with a seed.
109 *
110 * @param seed A seed to initialize the Mersenne-Twister RNG
111 *
112 * @returns A random UUID.
113 */
114 static UUID MakeRandomWithSeed(u32 seed);
115
116 /**
117 * Creates a random UUID. The generated UUID is RFC 4122 Version 4 compliant.
118 *
119 * @returns A random UUID that is RFC 4122 Version 4 compliant.
120 */
121 static UUID MakeRandomRFC4122V4();
122
123 friend constexpr bool operator==(const UUID& lhs, const UUID& rhs) = default;
75}; 124};
76static_assert(sizeof(UUID) == 16, "UUID is an invalid size!"); 125static_assert(sizeof(UUID) == 0x10, "UUID has incorrect size.");
126
127/// An invalid UUID. This UUID has all its bytes set to 0.
128constexpr UUID InvalidUUID = {};
77 129
78} // namespace Common 130} // namespace Common
79 131
@@ -82,7 +134,7 @@ namespace std {
82template <> 134template <>
83struct hash<Common::UUID> { 135struct hash<Common::UUID> {
84 size_t operator()(const Common::UUID& uuid) const noexcept { 136 size_t operator()(const Common::UUID& uuid) const noexcept {
85 return uuid.uuid[1] ^ uuid.uuid[0]; 137 return uuid.Hash();
86 } 138 }
87}; 139};
88 140
diff --git a/src/core/frontend/applets/profile_select.cpp b/src/core/frontend/applets/profile_select.cpp
index a7ff2ccf9..4c58c310f 100644
--- a/src/core/frontend/applets/profile_select.cpp
+++ b/src/core/frontend/applets/profile_select.cpp
@@ -11,9 +11,9 @@ namespace Core::Frontend {
11ProfileSelectApplet::~ProfileSelectApplet() = default; 11ProfileSelectApplet::~ProfileSelectApplet() = default;
12 12
13void DefaultProfileSelectApplet::SelectProfile( 13void DefaultProfileSelectApplet::SelectProfile(
14 std::function<void(std::optional<Common::NewUUID>)> callback) const { 14 std::function<void(std::optional<Common::UUID>)> callback) const {
15 Service::Account::ProfileManager manager; 15 Service::Account::ProfileManager manager;
16 callback(manager.GetUser(Settings::values.current_user.GetValue()).value_or(Common::NewUUID{})); 16 callback(manager.GetUser(Settings::values.current_user.GetValue()).value_or(Common::UUID{}));
17 LOG_INFO(Service_ACC, "called, selecting current user instead of prompting..."); 17 LOG_INFO(Service_ACC, "called, selecting current user instead of prompting...");
18} 18}
19 19
diff --git a/src/core/frontend/applets/profile_select.h b/src/core/frontend/applets/profile_select.h
index 5b2346e72..3506b9885 100644
--- a/src/core/frontend/applets/profile_select.h
+++ b/src/core/frontend/applets/profile_select.h
@@ -6,7 +6,7 @@
6 6
7#include <functional> 7#include <functional>
8#include <optional> 8#include <optional>
9#include "common/new_uuid.h" 9#include "common/uuid.h"
10 10
11namespace Core::Frontend { 11namespace Core::Frontend {
12 12
@@ -14,13 +14,12 @@ class ProfileSelectApplet {
14public: 14public:
15 virtual ~ProfileSelectApplet(); 15 virtual ~ProfileSelectApplet();
16 16
17 virtual void SelectProfile( 17 virtual void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const = 0;
18 std::function<void(std::optional<Common::NewUUID>)> callback) const = 0;
19}; 18};
20 19
21class DefaultProfileSelectApplet final : public ProfileSelectApplet { 20class DefaultProfileSelectApplet final : public ProfileSelectApplet {
22public: 21public:
23 void SelectProfile(std::function<void(std::optional<Common::NewUUID>)> callback) const override; 22 void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override;
24}; 23};
25 24
26} // namespace Core::Frontend 25} // namespace Core::Frontend
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 44e9f22b9..2bee173b3 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -204,7 +204,7 @@ void EmulatedController::ReloadInput() {
204 if (!button_devices[index]) { 204 if (!button_devices[index]) {
205 continue; 205 continue;
206 } 206 }
207 const auto uuid = Common::NewUUID{button_params[index].Get("guid", "")}; 207 const auto uuid = Common::UUID{button_params[index].Get("guid", "")};
208 button_devices[index]->SetCallback({ 208 button_devices[index]->SetCallback({
209 .on_change = 209 .on_change =
210 [this, index, uuid](const Common::Input::CallbackStatus& callback) { 210 [this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -218,7 +218,7 @@ void EmulatedController::ReloadInput() {
218 if (!stick_devices[index]) { 218 if (!stick_devices[index]) {
219 continue; 219 continue;
220 } 220 }
221 const auto uuid = Common::NewUUID{stick_params[index].Get("guid", "")}; 221 const auto uuid = Common::UUID{stick_params[index].Get("guid", "")};
222 stick_devices[index]->SetCallback({ 222 stick_devices[index]->SetCallback({
223 .on_change = 223 .on_change =
224 [this, index, uuid](const Common::Input::CallbackStatus& callback) { 224 [this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -232,7 +232,7 @@ void EmulatedController::ReloadInput() {
232 if (!trigger_devices[index]) { 232 if (!trigger_devices[index]) {
233 continue; 233 continue;
234 } 234 }
235 const auto uuid = Common::NewUUID{trigger_params[index].Get("guid", "")}; 235 const auto uuid = Common::UUID{trigger_params[index].Get("guid", "")};
236 trigger_devices[index]->SetCallback({ 236 trigger_devices[index]->SetCallback({
237 .on_change = 237 .on_change =
238 [this, index, uuid](const Common::Input::CallbackStatus& callback) { 238 [this, index, uuid](const Common::Input::CallbackStatus& callback) {
@@ -269,7 +269,7 @@ void EmulatedController::ReloadInput() {
269 } 269 }
270 270
271 // Use a common UUID for TAS 271 // Use a common UUID for TAS
272 static constexpr Common::NewUUID TAS_UUID = Common::NewUUID{ 272 static constexpr Common::UUID TAS_UUID = Common::UUID{
273 {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; 273 {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0xA5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
274 274
275 // Register TAS devices. No need to force update 275 // Register TAS devices. No need to force update
@@ -490,7 +490,7 @@ void EmulatedController::SetMotionParam(std::size_t index, Common::ParamPackage
490} 490}
491 491
492void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, 492void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
493 Common::NewUUID uuid) { 493 Common::UUID uuid) {
494 if (index >= controller.button_values.size()) { 494 if (index >= controller.button_values.size()) {
495 return; 495 return;
496 } 496 }
@@ -639,7 +639,7 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
639} 639}
640 640
641void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback, std::size_t index, 641void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback, std::size_t index,
642 Common::NewUUID uuid) { 642 Common::UUID uuid) {
643 if (index >= controller.stick_values.size()) { 643 if (index >= controller.stick_values.size()) {
644 return; 644 return;
645 } 645 }
@@ -689,7 +689,7 @@ void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback,
689} 689}
690 690
691void EmulatedController::SetTrigger(const Common::Input::CallbackStatus& callback, 691void EmulatedController::SetTrigger(const Common::Input::CallbackStatus& callback,
692 std::size_t index, Common::NewUUID uuid) { 692 std::size_t index, Common::UUID uuid) {
693 if (index >= controller.trigger_values.size()) { 693 if (index >= controller.trigger_values.size()) {
694 return; 694 return;
695 } 695 }
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h
index ed61e9522..d8642c5b3 100644
--- a/src/core/hid/emulated_controller.h
+++ b/src/core/hid/emulated_controller.h
@@ -354,7 +354,7 @@ private:
354 * @param index Button ID of the to be updated 354 * @param index Button ID of the to be updated
355 */ 355 */
356 void SetButton(const Common::Input::CallbackStatus& callback, std::size_t index, 356 void SetButton(const Common::Input::CallbackStatus& callback, std::size_t index,
357 Common::NewUUID uuid); 357 Common::UUID uuid);
358 358
359 /** 359 /**
360 * Updates the analog stick status of the controller 360 * Updates the analog stick status of the controller
@@ -362,7 +362,7 @@ private:
362 * @param index stick ID of the to be updated 362 * @param index stick ID of the to be updated
363 */ 363 */
364 void SetStick(const Common::Input::CallbackStatus& callback, std::size_t index, 364 void SetStick(const Common::Input::CallbackStatus& callback, std::size_t index,
365 Common::NewUUID uuid); 365 Common::UUID uuid);
366 366
367 /** 367 /**
368 * Updates the trigger status of the controller 368 * Updates the trigger status of the controller
@@ -370,7 +370,7 @@ private:
370 * @param index trigger ID of the to be updated 370 * @param index trigger ID of the to be updated
371 */ 371 */
372 void SetTrigger(const Common::Input::CallbackStatus& callback, std::size_t index, 372 void SetTrigger(const Common::Input::CallbackStatus& callback, std::size_t index,
373 Common::NewUUID uuid); 373 Common::UUID uuid);
374 374
375 /** 375 /**
376 * Updates the motion status of the controller 376 * Updates the motion status of the controller
diff --git a/src/core/hid/hid_types.h b/src/core/hid/hid_types.h
index a4ccdf11c..778b328b9 100644
--- a/src/core/hid/hid_types.h
+++ b/src/core/hid/hid_types.h
@@ -7,8 +7,8 @@
7#include "common/bit_field.h" 7#include "common/bit_field.h"
8#include "common/common_funcs.h" 8#include "common/common_funcs.h"
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "common/new_uuid.h"
11#include "common/point.h" 10#include "common/point.h"
11#include "common/uuid.h"
12 12
13namespace Core::HID { 13namespace Core::HID {
14 14
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 6abb7dbc4..e34ef5a78 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -39,7 +39,7 @@ constexpr ResultCode ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100};
39// Thumbnails are hard coded to be at least this size 39// Thumbnails are hard coded to be at least this size
40constexpr std::size_t THUMBNAIL_SIZE = 0x24000; 40constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
41 41
42static std::filesystem::path GetImagePath(const Common::NewUUID& uuid) { 42static std::filesystem::path GetImagePath(const Common::UUID& uuid) {
43 return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / 43 return Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
44 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); 44 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
45} 45}
@@ -51,7 +51,7 @@ static constexpr u32 SanitizeJPEGSize(std::size_t size) {
51 51
52class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> { 52class IManagerForSystemService final : public ServiceFramework<IManagerForSystemService> {
53public: 53public:
54 explicit IManagerForSystemService(Core::System& system_, Common::NewUUID) 54 explicit IManagerForSystemService(Core::System& system_, Common::UUID)
55 : ServiceFramework{system_, "IManagerForSystemService"} { 55 : ServiceFramework{system_, "IManagerForSystemService"} {
56 // clang-format off 56 // clang-format off
57 static const FunctionInfo functions[] = { 57 static const FunctionInfo functions[] = {
@@ -87,7 +87,7 @@ public:
87// 3.0.0+ 87// 3.0.0+
88class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> { 88class IFloatingRegistrationRequest final : public ServiceFramework<IFloatingRegistrationRequest> {
89public: 89public:
90 explicit IFloatingRegistrationRequest(Core::System& system_, Common::NewUUID) 90 explicit IFloatingRegistrationRequest(Core::System& system_, Common::UUID)
91 : ServiceFramework{system_, "IFloatingRegistrationRequest"} { 91 : ServiceFramework{system_, "IFloatingRegistrationRequest"} {
92 // clang-format off 92 // clang-format off
93 static const FunctionInfo functions[] = { 93 static const FunctionInfo functions[] = {
@@ -112,7 +112,7 @@ public:
112 112
113class IAdministrator final : public ServiceFramework<IAdministrator> { 113class IAdministrator final : public ServiceFramework<IAdministrator> {
114public: 114public:
115 explicit IAdministrator(Core::System& system_, Common::NewUUID) 115 explicit IAdministrator(Core::System& system_, Common::UUID)
116 : ServiceFramework{system_, "IAdministrator"} { 116 : ServiceFramework{system_, "IAdministrator"} {
117 // clang-format off 117 // clang-format off
118 static const FunctionInfo functions[] = { 118 static const FunctionInfo functions[] = {
@@ -170,7 +170,7 @@ public:
170 170
171class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> { 171class IAuthorizationRequest final : public ServiceFramework<IAuthorizationRequest> {
172public: 172public:
173 explicit IAuthorizationRequest(Core::System& system_, Common::NewUUID) 173 explicit IAuthorizationRequest(Core::System& system_, Common::UUID)
174 : ServiceFramework{system_, "IAuthorizationRequest"} { 174 : ServiceFramework{system_, "IAuthorizationRequest"} {
175 // clang-format off 175 // clang-format off
176 static const FunctionInfo functions[] = { 176 static const FunctionInfo functions[] = {
@@ -189,7 +189,7 @@ public:
189 189
190class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> { 190class IOAuthProcedure final : public ServiceFramework<IOAuthProcedure> {
191public: 191public:
192 explicit IOAuthProcedure(Core::System& system_, Common::NewUUID) 192 explicit IOAuthProcedure(Core::System& system_, Common::UUID)
193 : ServiceFramework{system_, "IOAuthProcedure"} { 193 : ServiceFramework{system_, "IOAuthProcedure"} {
194 // clang-format off 194 // clang-format off
195 static const FunctionInfo functions[] = { 195 static const FunctionInfo functions[] = {
@@ -208,7 +208,7 @@ public:
208// 3.0.0+ 208// 3.0.0+
209class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> { 209class IOAuthProcedureForExternalNsa final : public ServiceFramework<IOAuthProcedureForExternalNsa> {
210public: 210public:
211 explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::NewUUID) 211 explicit IOAuthProcedureForExternalNsa(Core::System& system_, Common::UUID)
212 : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} { 212 : ServiceFramework{system_, "IOAuthProcedureForExternalNsa"} {
213 // clang-format off 213 // clang-format off
214 static const FunctionInfo functions[] = { 214 static const FunctionInfo functions[] = {
@@ -231,7 +231,7 @@ public:
231class IOAuthProcedureForNintendoAccountLinkage final 231class IOAuthProcedureForNintendoAccountLinkage final
232 : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> { 232 : public ServiceFramework<IOAuthProcedureForNintendoAccountLinkage> {
233public: 233public:
234 explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::NewUUID) 234 explicit IOAuthProcedureForNintendoAccountLinkage(Core::System& system_, Common::UUID)
235 : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} { 235 : ServiceFramework{system_, "IOAuthProcedureForNintendoAccountLinkage"} {
236 // clang-format off 236 // clang-format off
237 static const FunctionInfo functions[] = { 237 static const FunctionInfo functions[] = {
@@ -252,7 +252,7 @@ public:
252 252
253class INotifier final : public ServiceFramework<INotifier> { 253class INotifier final : public ServiceFramework<INotifier> {
254public: 254public:
255 explicit INotifier(Core::System& system_, Common::NewUUID) 255 explicit INotifier(Core::System& system_, Common::UUID)
256 : ServiceFramework{system_, "INotifier"} { 256 : ServiceFramework{system_, "INotifier"} {
257 // clang-format off 257 // clang-format off
258 static const FunctionInfo functions[] = { 258 static const FunctionInfo functions[] = {
@@ -267,7 +267,7 @@ public:
267class IProfileCommon : public ServiceFramework<IProfileCommon> { 267class IProfileCommon : public ServiceFramework<IProfileCommon> {
268public: 268public:
269 explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, 269 explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands,
270 Common::NewUUID user_id_, ProfileManager& profile_manager_) 270 Common::UUID user_id_, ProfileManager& profile_manager_)
271 : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} { 271 : ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
272 static const FunctionInfo functions[] = { 272 static const FunctionInfo functions[] = {
273 {0, &IProfileCommon::Get, "Get"}, 273 {0, &IProfileCommon::Get, "Get"},
@@ -435,26 +435,26 @@ protected:
435 } 435 }
436 436
437 ProfileManager& profile_manager; 437 ProfileManager& profile_manager;
438 Common::NewUUID user_id{}; ///< The user id this profile refers to. 438 Common::UUID user_id{}; ///< The user id this profile refers to.
439}; 439};
440 440
441class IProfile final : public IProfileCommon { 441class IProfile final : public IProfileCommon {
442public: 442public:
443 explicit IProfile(Core::System& system_, Common::NewUUID user_id_, 443 explicit IProfile(Core::System& system_, Common::UUID user_id_,
444 ProfileManager& profile_manager_) 444 ProfileManager& profile_manager_)
445 : IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {} 445 : IProfileCommon{system_, "IProfile", false, user_id_, profile_manager_} {}
446}; 446};
447 447
448class IProfileEditor final : public IProfileCommon { 448class IProfileEditor final : public IProfileCommon {
449public: 449public:
450 explicit IProfileEditor(Core::System& system_, Common::NewUUID user_id_, 450 explicit IProfileEditor(Core::System& system_, Common::UUID user_id_,
451 ProfileManager& profile_manager_) 451 ProfileManager& profile_manager_)
452 : IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {} 452 : IProfileCommon{system_, "IProfileEditor", true, user_id_, profile_manager_} {}
453}; 453};
454 454
455class ISessionObject final : public ServiceFramework<ISessionObject> { 455class ISessionObject final : public ServiceFramework<ISessionObject> {
456public: 456public:
457 explicit ISessionObject(Core::System& system_, Common::NewUUID) 457 explicit ISessionObject(Core::System& system_, Common::UUID)
458 : ServiceFramework{system_, "ISessionObject"} { 458 : ServiceFramework{system_, "ISessionObject"} {
459 // clang-format off 459 // clang-format off
460 static const FunctionInfo functions[] = { 460 static const FunctionInfo functions[] = {
@@ -468,7 +468,7 @@ public:
468 468
469class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> { 469class IGuestLoginRequest final : public ServiceFramework<IGuestLoginRequest> {
470public: 470public:
471 explicit IGuestLoginRequest(Core::System& system_, Common::NewUUID) 471 explicit IGuestLoginRequest(Core::System& system_, Common::UUID)
472 : ServiceFramework{system_, "IGuestLoginRequest"} { 472 : ServiceFramework{system_, "IGuestLoginRequest"} {
473 // clang-format off 473 // clang-format off
474 static const FunctionInfo functions[] = { 474 static const FunctionInfo functions[] = {
@@ -514,7 +514,7 @@ protected:
514 514
515class IManagerForApplication final : public ServiceFramework<IManagerForApplication> { 515class IManagerForApplication final : public ServiceFramework<IManagerForApplication> {
516public: 516public:
517 explicit IManagerForApplication(Core::System& system_, Common::NewUUID user_id_) 517 explicit IManagerForApplication(Core::System& system_, Common::UUID user_id_)
518 : ServiceFramework{system_, "IManagerForApplication"}, 518 : ServiceFramework{system_, "IManagerForApplication"},
519 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)}, 519 ensure_token_id{std::make_shared<EnsureTokenIdCacheAsyncInterface>(system)},
520 user_id{user_id_} { 520 user_id{user_id_} {
@@ -587,14 +587,14 @@ private:
587 } 587 }
588 588
589 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{}; 589 std::shared_ptr<EnsureTokenIdCacheAsyncInterface> ensure_token_id{};
590 Common::NewUUID user_id{}; 590 Common::UUID user_id{};
591}; 591};
592 592
593// 6.0.0+ 593// 6.0.0+
594class IAsyncNetworkServiceLicenseKindContext final 594class IAsyncNetworkServiceLicenseKindContext final
595 : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> { 595 : public ServiceFramework<IAsyncNetworkServiceLicenseKindContext> {
596public: 596public:
597 explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::NewUUID) 597 explicit IAsyncNetworkServiceLicenseKindContext(Core::System& system_, Common::UUID)
598 : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} { 598 : ServiceFramework{system_, "IAsyncNetworkServiceLicenseKindContext"} {
599 // clang-format off 599 // clang-format off
600 static const FunctionInfo functions[] = { 600 static const FunctionInfo functions[] = {
@@ -614,7 +614,7 @@ public:
614class IOAuthProcedureForUserRegistration final 614class IOAuthProcedureForUserRegistration final
615 : public ServiceFramework<IOAuthProcedureForUserRegistration> { 615 : public ServiceFramework<IOAuthProcedureForUserRegistration> {
616public: 616public:
617 explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::NewUUID) 617 explicit IOAuthProcedureForUserRegistration(Core::System& system_, Common::UUID)
618 : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} { 618 : ServiceFramework{system_, "IOAuthProcedureForUserRegistration"} {
619 // clang-format off 619 // clang-format off
620 static const FunctionInfo functions[] = { 620 static const FunctionInfo functions[] = {
@@ -638,8 +638,7 @@ public:
638 638
639class DAUTH_O final : public ServiceFramework<DAUTH_O> { 639class DAUTH_O final : public ServiceFramework<DAUTH_O> {
640public: 640public:
641 explicit DAUTH_O(Core::System& system_, Common::NewUUID) 641 explicit DAUTH_O(Core::System& system_, Common::UUID) : ServiceFramework{system_, "dauth:o"} {
642 : ServiceFramework{system_, "dauth:o"} {
643 // clang-format off 642 // clang-format off
644 static const FunctionInfo functions[] = { 643 static const FunctionInfo functions[] = {
645 {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, 644 {0, nullptr, "EnsureAuthenticationTokenCacheAsync"},
@@ -663,7 +662,7 @@ public:
663// 6.0.0+ 662// 6.0.0+
664class IAsyncResult final : public ServiceFramework<IAsyncResult> { 663class IAsyncResult final : public ServiceFramework<IAsyncResult> {
665public: 664public:
666 explicit IAsyncResult(Core::System& system_, Common::NewUUID) 665 explicit IAsyncResult(Core::System& system_, Common::UUID)
667 : ServiceFramework{system_, "IAsyncResult"} { 666 : ServiceFramework{system_, "IAsyncResult"} {
668 // clang-format off 667 // clang-format off
669 static const FunctionInfo functions[] = { 668 static const FunctionInfo functions[] = {
@@ -687,7 +686,7 @@ void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) {
687 686
688void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) { 687void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
689 IPC::RequestParser rp{ctx}; 688 IPC::RequestParser rp{ctx};
690 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 689 Common::UUID user_id = rp.PopRaw<Common::UUID>();
691 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); 690 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
692 691
693 IPC::ResponseBuilder rb{ctx, 3}; 692 IPC::ResponseBuilder rb{ctx, 3};
@@ -713,12 +712,12 @@ void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
713 LOG_DEBUG(Service_ACC, "called"); 712 LOG_DEBUG(Service_ACC, "called");
714 IPC::ResponseBuilder rb{ctx, 6}; 713 IPC::ResponseBuilder rb{ctx, 6};
715 rb.Push(ResultSuccess); 714 rb.Push(ResultSuccess);
716 rb.PushRaw<Common::NewUUID>(profile_manager->GetLastOpenedUser()); 715 rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser());
717} 716}
718 717
719void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) { 718void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
720 IPC::RequestParser rp{ctx}; 719 IPC::RequestParser rp{ctx};
721 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 720 Common::UUID user_id = rp.PopRaw<Common::UUID>();
722 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString()); 721 LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
723 722
724 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 723 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
@@ -832,7 +831,7 @@ void Module::Interface::InitializeApplicationInfoV2(Kernel::HLERequestContext& c
832 831
833void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) { 832void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
834 IPC::RequestParser rp{ctx}; 833 IPC::RequestParser rp{ctx};
835 Common::NewUUID user_id = rp.PopRaw<Common::NewUUID>(); 834 Common::UUID user_id = rp.PopRaw<Common::UUID>();
836 835
837 LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString()); 836 LOG_DEBUG(Service_ACC, "called, user_id=0x{}", user_id.RawString());
838 837
@@ -874,7 +873,7 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct
874 873
875void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { 874void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) {
876 IPC::RequestParser rp{ctx}; 875 IPC::RequestParser rp{ctx};
877 const auto uuid = rp.PopRaw<Common::NewUUID>(); 876 const auto uuid = rp.PopRaw<Common::UUID>();
878 877
879 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString()); 878 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}", uuid.RawString());
880 879
@@ -887,7 +886,7 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont
887 886
888void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) { 887void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) {
889 IPC::RequestParser rp{ctx}; 888 IPC::RequestParser rp{ctx};
890 const auto uuid = rp.PopRaw<Common::NewUUID>(); 889 const auto uuid = rp.PopRaw<Common::UUID>();
891 const auto tid = rp.Pop<u64_le>(); 890 const auto tid = rp.Pop<u64_le>();
892 891
893 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid); 892 LOG_WARNING(Service_ACC, "(STUBBED) called, uuid=0x{}, tid={:016X}", uuid.RawString(), tid);
@@ -895,7 +894,7 @@ void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext&
895} 894}
896 895
897void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, 896void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
898 const Common::NewUUID& uuid, const u64 tid) { 897 const Common::UUID& uuid, const u64 tid) {
899 IPC::ResponseBuilder rb{ctx, 2}; 898 IPC::ResponseBuilder rb{ctx, 2};
900 899
901 if (tid == 0) { 900 if (tid == 0) {
diff --git a/src/core/hle/service/acc/acc.h b/src/core/hle/service/acc/acc.h
index b57342701..f7e9bc4f8 100644
--- a/src/core/hle/service/acc/acc.h
+++ b/src/core/hle/service/acc/acc.h
@@ -4,7 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "common/new_uuid.h" 7#include "common/uuid.h"
8#include "core/hle/service/glue/glue_manager.h" 8#include "core/hle/service/glue/glue_manager.h"
9#include "core/hle/service/service.h" 9#include "core/hle/service/service.h"
10 10
@@ -43,7 +43,7 @@ public:
43 43
44 private: 44 private:
45 ResultCode InitializeApplicationInfoBase(); 45 ResultCode InitializeApplicationInfoBase();
46 void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::NewUUID& uuid, 46 void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::UUID& uuid,
47 const u64 tid); 47 const u64 tid);
48 48
49 enum class ApplicationType : u32_le { 49 enum class ApplicationType : u32_le {
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 366f3fe14..fba847142 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -16,11 +16,11 @@
16namespace Service::Account { 16namespace Service::Account {
17 17
18namespace FS = Common::FS; 18namespace FS = Common::FS;
19using Common::NewUUID; 19using Common::UUID;
20 20
21struct UserRaw { 21struct UserRaw {
22 NewUUID uuid{}; 22 UUID uuid{};
23 NewUUID uuid2{}; 23 UUID uuid2{};
24 u64 timestamp{}; 24 u64 timestamp{};
25 ProfileUsername username{}; 25 ProfileUsername username{};
26 ProfileData extra_data{}; 26 ProfileData extra_data{};
@@ -45,7 +45,7 @@ ProfileManager::ProfileManager() {
45 45
46 // Create an user if none are present 46 // Create an user if none are present
47 if (user_count == 0) { 47 if (user_count == 0) {
48 CreateNewUser(NewUUID::MakeRandom(), "yuzu"); 48 CreateNewUser(UUID::MakeRandom(), "yuzu");
49 } 49 }
50 50
51 auto current = 51 auto current =
@@ -97,7 +97,7 @@ ResultCode ProfileManager::AddUser(const ProfileInfo& user) {
97 97
98/// Create a new user on the system. If the uuid of the user already exists, the user is not 98/// Create a new user on the system. If the uuid of the user already exists, the user is not
99/// created. 99/// created.
100ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& username) { 100ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username) {
101 if (user_count == MAX_USERS) { 101 if (user_count == MAX_USERS) {
102 return ERROR_TOO_MANY_USERS; 102 return ERROR_TOO_MANY_USERS;
103 } 103 }
@@ -124,7 +124,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const ProfileUsername& us
124/// Creates a new user on the system. This function allows a much simpler method of registration 124/// Creates a new user on the system. This function allows a much simpler method of registration
125/// specifically by allowing an std::string for the username. This is required specifically since 125/// specifically by allowing an std::string for the username. This is required specifically since
126/// we're loading a string straight from the config 126/// we're loading a string straight from the config
127ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& username) { 127ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
128 ProfileUsername username_output{}; 128 ProfileUsername username_output{};
129 129
130 if (username.size() > username_output.size()) { 130 if (username.size() > username_output.size()) {
@@ -135,7 +135,7 @@ ResultCode ProfileManager::CreateNewUser(NewUUID uuid, const std::string& userna
135 return CreateNewUser(uuid, username_output); 135 return CreateNewUser(uuid, username_output);
136} 136}
137 137
138std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const { 138std::optional<UUID> ProfileManager::GetUser(std::size_t index) const {
139 if (index >= MAX_USERS) { 139 if (index >= MAX_USERS) {
140 return std::nullopt; 140 return std::nullopt;
141 } 141 }
@@ -144,7 +144,7 @@ std::optional<NewUUID> ProfileManager::GetUser(std::size_t index) const {
144} 144}
145 145
146/// Returns a users profile index based on their user id. 146/// Returns a users profile index based on their user id.
147std::optional<std::size_t> ProfileManager::GetUserIndex(const NewUUID& uuid) const { 147std::optional<std::size_t> ProfileManager::GetUserIndex(const UUID& uuid) const {
148 if (uuid.IsInvalid()) { 148 if (uuid.IsInvalid()) {
149 return std::nullopt; 149 return std::nullopt;
150 } 150 }
@@ -176,7 +176,7 @@ bool ProfileManager::GetProfileBase(std::optional<std::size_t> index, ProfileBas
176} 176}
177 177
178/// Returns the data structure used by the switch when GetProfileBase is called on acc:* 178/// Returns the data structure used by the switch when GetProfileBase is called on acc:*
179bool ProfileManager::GetProfileBase(NewUUID uuid, ProfileBase& profile) const { 179bool ProfileManager::GetProfileBase(UUID uuid, ProfileBase& profile) const {
180 const auto idx = GetUserIndex(uuid); 180 const auto idx = GetUserIndex(uuid);
181 return GetProfileBase(idx, profile); 181 return GetProfileBase(idx, profile);
182} 182}
@@ -203,7 +203,7 @@ std::size_t ProfileManager::GetOpenUserCount() const {
203} 203}
204 204
205/// Checks if a user id exists in our profile manager 205/// Checks if a user id exists in our profile manager
206bool ProfileManager::UserExists(NewUUID uuid) const { 206bool ProfileManager::UserExists(UUID uuid) const {
207 return GetUserIndex(uuid).has_value(); 207 return GetUserIndex(uuid).has_value();
208} 208}
209 209
@@ -215,7 +215,7 @@ bool ProfileManager::UserExistsIndex(std::size_t index) const {
215} 215}
216 216
217/// Opens a specific user 217/// Opens a specific user
218void ProfileManager::OpenUser(NewUUID uuid) { 218void ProfileManager::OpenUser(UUID uuid) {
219 const auto idx = GetUserIndex(uuid); 219 const auto idx = GetUserIndex(uuid);
220 if (!idx) { 220 if (!idx) {
221 return; 221 return;
@@ -226,7 +226,7 @@ void ProfileManager::OpenUser(NewUUID uuid) {
226} 226}
227 227
228/// Closes a specific user 228/// Closes a specific user
229void ProfileManager::CloseUser(NewUUID uuid) { 229void ProfileManager::CloseUser(UUID uuid) {
230 const auto idx = GetUserIndex(uuid); 230 const auto idx = GetUserIndex(uuid);
231 if (!idx) { 231 if (!idx) {
232 return; 232 return;
@@ -253,12 +253,12 @@ UserIDArray ProfileManager::GetOpenUsers() const {
253 return Common::InvalidUUID; 253 return Common::InvalidUUID;
254 }); 254 });
255 std::stable_partition(output.begin(), output.end(), 255 std::stable_partition(output.begin(), output.end(),
256 [](const NewUUID& uuid) { return uuid.IsValid(); }); 256 [](const UUID& uuid) { return uuid.IsValid(); });
257 return output; 257 return output;
258} 258}
259 259
260/// Returns the last user which was opened 260/// Returns the last user which was opened
261NewUUID ProfileManager::GetLastOpenedUser() const { 261UUID ProfileManager::GetLastOpenedUser() const {
262 return last_opened_user; 262 return last_opened_user;
263} 263}
264 264
@@ -273,7 +273,7 @@ bool ProfileManager::GetProfileBaseAndData(std::optional<std::size_t> index, Pro
273} 273}
274 274
275/// Return the users profile base and the unknown arbitary data. 275/// Return the users profile base and the unknown arbitary data.
276bool ProfileManager::GetProfileBaseAndData(NewUUID uuid, ProfileBase& profile, 276bool ProfileManager::GetProfileBaseAndData(UUID uuid, ProfileBase& profile,
277 ProfileData& data) const { 277 ProfileData& data) const {
278 const auto idx = GetUserIndex(uuid); 278 const auto idx = GetUserIndex(uuid);
279 return GetProfileBaseAndData(idx, profile, data); 279 return GetProfileBaseAndData(idx, profile, data);
@@ -292,7 +292,7 @@ bool ProfileManager::CanSystemRegisterUser() const {
292 // emulate qlaunch. Update this to dynamically change. 292 // emulate qlaunch. Update this to dynamically change.
293} 293}
294 294
295bool ProfileManager::RemoveUser(NewUUID uuid) { 295bool ProfileManager::RemoveUser(UUID uuid) {
296 const auto index = GetUserIndex(uuid); 296 const auto index = GetUserIndex(uuid);
297 if (!index) { 297 if (!index) {
298 return false; 298 return false;
@@ -304,7 +304,7 @@ bool ProfileManager::RemoveUser(NewUUID uuid) {
304 return true; 304 return true;
305} 305}
306 306
307bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new) { 307bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
308 const auto index = GetUserIndex(uuid); 308 const auto index = GetUserIndex(uuid);
309 if (!index || profile_new.user_uuid.IsInvalid()) { 309 if (!index || profile_new.user_uuid.IsInvalid()) {
310 return false; 310 return false;
@@ -318,7 +318,7 @@ bool ProfileManager::SetProfileBase(NewUUID uuid, const ProfileBase& profile_new
318 return true; 318 return true;
319} 319}
320 320
321bool ProfileManager::SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, 321bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
322 const ProfileData& data_new) { 322 const ProfileData& data_new) {
323 const auto index = GetUserIndex(uuid); 323 const auto index = GetUserIndex(uuid);
324 if (index.has_value() && SetProfileBase(uuid, profile_new)) { 324 if (index.has_value() && SetProfileBase(uuid, profile_new)) {
@@ -336,14 +336,14 @@ void ProfileManager::ParseUserSaveFile() {
336 336
337 if (!save.IsOpen()) { 337 if (!save.IsOpen()) {
338 LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new " 338 LOG_WARNING(Service_ACC, "Failed to load profile data from save data... Generating new "
339 "user 'yuzu' with random NewUUID."); 339 "user 'yuzu' with random UUID.");
340 return; 340 return;
341 } 341 }
342 342
343 ProfileDataRaw data; 343 ProfileDataRaw data;
344 if (!save.ReadObject(data)) { 344 if (!save.ReadObject(data)) {
345 LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user " 345 LOG_WARNING(Service_ACC, "profiles.dat is smaller than expected... Generating new user "
346 "'yuzu' with random NewUUID."); 346 "'yuzu' with random UUID.");
347 return; 347 return;
348 } 348 }
349 349
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h
index e9c58a826..17347f7ef 100644
--- a/src/core/hle/service/acc/profile_manager.h
+++ b/src/core/hle/service/acc/profile_manager.h
@@ -8,8 +8,8 @@
8#include <optional> 8#include <optional>
9 9
10#include "common/common_types.h" 10#include "common/common_types.h"
11#include "common/new_uuid.h"
12#include "common/swap.h" 11#include "common/swap.h"
12#include "common/uuid.h"
13#include "core/hle/result.h" 13#include "core/hle/result.h"
14 14
15namespace Service::Account { 15namespace Service::Account {
@@ -18,7 +18,7 @@ constexpr std::size_t MAX_USERS{8};
18constexpr std::size_t profile_username_size{32}; 18constexpr std::size_t profile_username_size{32};
19 19
20using ProfileUsername = std::array<u8, profile_username_size>; 20using ProfileUsername = std::array<u8, profile_username_size>;
21using UserIDArray = std::array<Common::NewUUID, MAX_USERS>; 21using UserIDArray = std::array<Common::UUID, MAX_USERS>;
22 22
23/// Contains extra data related to a user. 23/// Contains extra data related to a user.
24/// TODO: RE this structure 24/// TODO: RE this structure
@@ -35,7 +35,7 @@ static_assert(sizeof(ProfileData) == 0x80, "ProfileData structure has incorrect
35/// This holds general information about a users profile. This is where we store all the information 35/// This holds general information about a users profile. This is where we store all the information
36/// based on a specific user 36/// based on a specific user
37struct ProfileInfo { 37struct ProfileInfo {
38 Common::NewUUID user_uuid{}; 38 Common::UUID user_uuid{};
39 ProfileUsername username{}; 39 ProfileUsername username{};
40 u64 creation_time{}; 40 u64 creation_time{};
41 ProfileData data{}; // TODO(ognik): Work out what this is 41 ProfileData data{}; // TODO(ognik): Work out what this is
@@ -43,7 +43,7 @@ struct ProfileInfo {
43}; 43};
44 44
45struct ProfileBase { 45struct ProfileBase {
46 Common::NewUUID user_uuid; 46 Common::UUID user_uuid;
47 u64_le timestamp; 47 u64_le timestamp;
48 ProfileUsername username; 48 ProfileUsername username;
49 49
@@ -65,34 +65,34 @@ public:
65 ~ProfileManager(); 65 ~ProfileManager();
66 66
67 ResultCode AddUser(const ProfileInfo& user); 67 ResultCode AddUser(const ProfileInfo& user);
68 ResultCode CreateNewUser(Common::NewUUID uuid, const ProfileUsername& username); 68 ResultCode CreateNewUser(Common::UUID uuid, const ProfileUsername& username);
69 ResultCode CreateNewUser(Common::NewUUID uuid, const std::string& username); 69 ResultCode CreateNewUser(Common::UUID uuid, const std::string& username);
70 std::optional<Common::NewUUID> GetUser(std::size_t index) const; 70 std::optional<Common::UUID> GetUser(std::size_t index) const;
71 std::optional<std::size_t> GetUserIndex(const Common::NewUUID& uuid) const; 71 std::optional<std::size_t> GetUserIndex(const Common::UUID& uuid) const;
72 std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const; 72 std::optional<std::size_t> GetUserIndex(const ProfileInfo& user) const;
73 bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const; 73 bool GetProfileBase(std::optional<std::size_t> index, ProfileBase& profile) const;
74 bool GetProfileBase(Common::NewUUID uuid, ProfileBase& profile) const; 74 bool GetProfileBase(Common::UUID uuid, ProfileBase& profile) const;
75 bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const; 75 bool GetProfileBase(const ProfileInfo& user, ProfileBase& profile) const;
76 bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile, 76 bool GetProfileBaseAndData(std::optional<std::size_t> index, ProfileBase& profile,
77 ProfileData& data) const; 77 ProfileData& data) const;
78 bool GetProfileBaseAndData(Common::NewUUID uuid, ProfileBase& profile, ProfileData& data) const; 78 bool GetProfileBaseAndData(Common::UUID uuid, ProfileBase& profile, ProfileData& data) const;
79 bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile, 79 bool GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& profile,
80 ProfileData& data) const; 80 ProfileData& data) const;
81 std::size_t GetUserCount() const; 81 std::size_t GetUserCount() const;
82 std::size_t GetOpenUserCount() const; 82 std::size_t GetOpenUserCount() const;
83 bool UserExists(Common::NewUUID uuid) const; 83 bool UserExists(Common::UUID uuid) const;
84 bool UserExistsIndex(std::size_t index) const; 84 bool UserExistsIndex(std::size_t index) const;
85 void OpenUser(Common::NewUUID uuid); 85 void OpenUser(Common::UUID uuid);
86 void CloseUser(Common::NewUUID uuid); 86 void CloseUser(Common::UUID uuid);
87 UserIDArray GetOpenUsers() const; 87 UserIDArray GetOpenUsers() const;
88 UserIDArray GetAllUsers() const; 88 UserIDArray GetAllUsers() const;
89 Common::NewUUID GetLastOpenedUser() const; 89 Common::UUID GetLastOpenedUser() const;
90 90
91 bool CanSystemRegisterUser() const; 91 bool CanSystemRegisterUser() const;
92 92
93 bool RemoveUser(Common::NewUUID uuid); 93 bool RemoveUser(Common::UUID uuid);
94 bool SetProfileBase(Common::NewUUID uuid, const ProfileBase& profile_new); 94 bool SetProfileBase(Common::UUID uuid, const ProfileBase& profile_new);
95 bool SetProfileBaseAndData(Common::NewUUID uuid, const ProfileBase& profile_new, 95 bool SetProfileBaseAndData(Common::UUID uuid, const ProfileBase& profile_new,
96 const ProfileData& data_new); 96 const ProfileData& data_new);
97 97
98private: 98private:
@@ -103,7 +103,7 @@ private:
103 103
104 std::array<ProfileInfo, MAX_USERS> profiles{}; 104 std::array<ProfileInfo, MAX_USERS> profiles{};
105 std::size_t user_count{}; 105 std::size_t user_count{};
106 Common::NewUUID last_opened_user{}; 106 Common::UUID last_opened_user{};
107}; 107};
108 108
109}; // namespace Service::Account 109}; // namespace Service::Account
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 4cdc029b7..773dc9f29 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -55,7 +55,7 @@ constexpr u32 LAUNCH_PARAMETER_ACCOUNT_PRESELECTED_USER_MAGIC = 0xC79497CA;
55struct LaunchParameterAccountPreselectedUser { 55struct LaunchParameterAccountPreselectedUser {
56 u32_le magic; 56 u32_le magic;
57 u32_le is_account_selected; 57 u32_le is_account_selected;
58 Common::NewUUID current_user; 58 Common::UUID current_user;
59 INSERT_PADDING_BYTES(0x70); 59 INSERT_PADDING_BYTES(0x70);
60}; 60};
61static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88); 61static_assert(sizeof(LaunchParameterAccountPreselectedUser) == 0x88);
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp
index 3ac32fa58..82500e121 100644
--- a/src/core/hle/service/am/applets/applet_profile_select.cpp
+++ b/src/core/hle/service/am/applets/applet_profile_select.cpp
@@ -54,11 +54,10 @@ void ProfileSelect::Execute() {
54 return; 54 return;
55 } 55 }
56 56
57 frontend.SelectProfile( 57 frontend.SelectProfile([this](std::optional<Common::UUID> uuid) { SelectionComplete(uuid); });
58 [this](std::optional<Common::NewUUID> uuid) { SelectionComplete(uuid); });
59} 58}
60 59
61void ProfileSelect::SelectionComplete(std::optional<Common::NewUUID> uuid) { 60void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
62 UserSelectionOutput output{}; 61 UserSelectionOutput output{};
63 62
64 if (uuid.has_value() && uuid->IsValid()) { 63 if (uuid.has_value() && uuid->IsValid()) {
diff --git a/src/core/hle/service/am/applets/applet_profile_select.h b/src/core/hle/service/am/applets/applet_profile_select.h
index c5c506c41..852e1e0c0 100644
--- a/src/core/hle/service/am/applets/applet_profile_select.h
+++ b/src/core/hle/service/am/applets/applet_profile_select.h
@@ -7,7 +7,7 @@
7#include <vector> 7#include <vector>
8 8
9#include "common/common_funcs.h" 9#include "common/common_funcs.h"
10#include "common/new_uuid.h" 10#include "common/uuid.h"
11#include "core/hle/result.h" 11#include "core/hle/result.h"
12#include "core/hle/service/am/applets/applets.h" 12#include "core/hle/service/am/applets/applets.h"
13 13
@@ -27,7 +27,7 @@ static_assert(sizeof(UserSelectionConfig) == 0xA0, "UserSelectionConfig has inco
27 27
28struct UserSelectionOutput { 28struct UserSelectionOutput {
29 u64 result; 29 u64 result;
30 Common::NewUUID uuid_selected; 30 Common::UUID uuid_selected;
31}; 31};
32static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size."); 32static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size.");
33 33
@@ -44,7 +44,7 @@ public:
44 void ExecuteInteractive() override; 44 void ExecuteInteractive() override;
45 void Execute() override; 45 void Execute() override;
46 46
47 void SelectionComplete(std::optional<Common::NewUUID> uuid); 47 void SelectionComplete(std::optional<Common::UUID> uuid);
48 48
49private: 49private:
50 const Core::Frontend::ProfileSelectApplet& frontend; 50 const Core::Frontend::ProfileSelectApplet& frontend;
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 3c621f7f0..79cd3acbb 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -4,7 +4,7 @@
4 4
5#include <queue> 5#include <queue>
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7#include "common/new_uuid.h" 7#include "common/uuid.h"
8#include "core/core.h" 8#include "core/core.h"
9#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
10#include "core/hle/kernel/k_event.h" 10#include "core/hle/kernel/k_event.h"
@@ -170,7 +170,7 @@ private:
170 void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) { 170 void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) {
171 IPC::RequestParser rp{ctx}; 171 IPC::RequestParser rp{ctx};
172 const auto local_play = rp.Pop<bool>(); 172 const auto local_play = rp.Pop<bool>();
173 const auto uuid = rp.PopRaw<Common::NewUUID>(); 173 const auto uuid = rp.PopRaw<Common::UUID>();
174 174
175 LOG_WARNING(Service_Friend, "(STUBBED) called, local_play={}, uuid=0x{}", local_play, 175 LOG_WARNING(Service_Friend, "(STUBBED) called, local_play={}, uuid=0x{}", local_play,
176 uuid.RawString()); 176 uuid.RawString());
@@ -182,7 +182,7 @@ private:
182 void GetFriendList(Kernel::HLERequestContext& ctx) { 182 void GetFriendList(Kernel::HLERequestContext& ctx) {
183 IPC::RequestParser rp{ctx}; 183 IPC::RequestParser rp{ctx};
184 const auto friend_offset = rp.Pop<u32>(); 184 const auto friend_offset = rp.Pop<u32>();
185 const auto uuid = rp.PopRaw<Common::NewUUID>(); 185 const auto uuid = rp.PopRaw<Common::UUID>();
186 [[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>(); 186 [[maybe_unused]] const auto filter = rp.PopRaw<SizedFriendFilter>();
187 const auto pid = rp.Pop<u64>(); 187 const auto pid = rp.Pop<u64>();
188 LOG_WARNING(Service_Friend, "(STUBBED) called, offset={}, uuid=0x{}, pid={}", friend_offset, 188 LOG_WARNING(Service_Friend, "(STUBBED) called, offset={}, uuid=0x{}, pid={}", friend_offset,
@@ -202,7 +202,7 @@ private:
202 202
203class INotificationService final : public ServiceFramework<INotificationService> { 203class INotificationService final : public ServiceFramework<INotificationService> {
204public: 204public:
205 explicit INotificationService(Core::System& system_, Common::NewUUID uuid_) 205 explicit INotificationService(Core::System& system_, Common::UUID uuid_)
206 : ServiceFramework{system_, "INotificationService"}, uuid{uuid_}, 206 : ServiceFramework{system_, "INotificationService"}, uuid{uuid_},
207 service_context{system_, "INotificationService"} { 207 service_context{system_, "INotificationService"} {
208 // clang-format off 208 // clang-format off
@@ -293,7 +293,7 @@ private:
293 bool has_received_friend_request; 293 bool has_received_friend_request;
294 }; 294 };
295 295
296 Common::NewUUID uuid; 296 Common::UUID uuid;
297 KernelHelpers::ServiceContext service_context; 297 KernelHelpers::ServiceContext service_context;
298 298
299 Kernel::KEvent* notification_event; 299 Kernel::KEvent* notification_event;
@@ -310,7 +310,7 @@ void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
310 310
311void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx) { 311void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx) {
312 IPC::RequestParser rp{ctx}; 312 IPC::RequestParser rp{ctx};
313 auto uuid = rp.PopRaw<Common::NewUUID>(); 313 auto uuid = rp.PopRaw<Common::UUID>();
314 314
315 LOG_DEBUG(Service_Friend, "called, uuid=0x{}", uuid.RawString()); 315 LOG_DEBUG(Service_Friend, "called, uuid=0x{}", uuid.RawString());
316 316
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp
index aa1a9a6c7..0a57c3cde 100644
--- a/src/core/hle/service/mii/mii_manager.cpp
+++ b/src/core/hle/service/mii/mii_manager.cpp
@@ -131,8 +131,7 @@ T GetRandomValue(T max) {
131 return GetRandomValue<T>({}, max); 131 return GetRandomValue<T>({}, max);
132} 132}
133 133
134MiiStoreData BuildRandomStoreData(Age age, Gender gender, Race race, 134MiiStoreData BuildRandomStoreData(Age age, Gender gender, Race race, const Common::UUID& user_id) {
135 const Common::NewUUID& user_id) {
136 MiiStoreBitFields bf{}; 135 MiiStoreBitFields bf{};
137 136
138 if (gender == Gender::All) { 137 if (gender == Gender::All) {
@@ -311,7 +310,7 @@ MiiStoreData BuildRandomStoreData(Age age, Gender gender, Race race,
311 return {DefaultMiiName, bf, user_id}; 310 return {DefaultMiiName, bf, user_id};
312} 311}
313 312
314MiiStoreData BuildDefaultStoreData(const DefaultMii& info, const Common::NewUUID& user_id) { 313MiiStoreData BuildDefaultStoreData(const DefaultMii& info, const Common::UUID& user_id) {
315 MiiStoreBitFields bf{}; 314 MiiStoreBitFields bf{};
316 315
317 bf.font_region.Assign(info.font_region); 316 bf.font_region.Assign(info.font_region);
@@ -372,13 +371,13 @@ MiiStoreData BuildDefaultStoreData(const DefaultMii& info, const Common::NewUUID
372MiiStoreData::MiiStoreData() = default; 371MiiStoreData::MiiStoreData() = default;
373 372
374MiiStoreData::MiiStoreData(const MiiStoreData::Name& name, const MiiStoreBitFields& bit_fields, 373MiiStoreData::MiiStoreData(const MiiStoreData::Name& name, const MiiStoreBitFields& bit_fields,
375 const Common::NewUUID& user_id) { 374 const Common::UUID& user_id) {
376 data.name = name; 375 data.name = name;
377 data.uuid = Common::NewUUID::MakeRandomRFC4122V4(); 376 data.uuid = Common::UUID::MakeRandomRFC4122V4();
378 377
379 std::memcpy(data.data.data(), &bit_fields, sizeof(MiiStoreBitFields)); 378 std::memcpy(data.data.data(), &bit_fields, sizeof(MiiStoreBitFields));
380 data_crc = GenerateCrc16(data.data.data(), sizeof(data)); 379 data_crc = GenerateCrc16(data.data.data(), sizeof(data));
381 device_crc = GenerateCrc16(&user_id, sizeof(Common::NewUUID)); 380 device_crc = GenerateCrc16(&user_id, sizeof(Common::UUID));
382} 381}
383 382
384MiiManager::MiiManager() : user_id{Service::Account::ProfileManager().GetLastOpenedUser()} {} 383MiiManager::MiiManager() : user_id{Service::Account::ProfileManager().GetLastOpenedUser()} {}
diff --git a/src/core/hle/service/mii/mii_manager.h b/src/core/hle/service/mii/mii_manager.h
index 580a64fc9..6999d15b1 100644
--- a/src/core/hle/service/mii/mii_manager.h
+++ b/src/core/hle/service/mii/mii_manager.h
@@ -8,7 +8,7 @@
8#include <vector> 8#include <vector>
9#include "common/bit_field.h" 9#include "common/bit_field.h"
10#include "common/common_funcs.h" 10#include "common/common_funcs.h"
11#include "common/new_uuid.h" 11#include "common/uuid.h"
12#include "core/hle/result.h" 12#include "core/hle/result.h"
13#include "core/hle/service/mii/types.h" 13#include "core/hle/service/mii/types.h"
14 14
@@ -29,7 +29,7 @@ enum class SourceFlag : u32 {
29DECLARE_ENUM_FLAG_OPERATORS(SourceFlag); 29DECLARE_ENUM_FLAG_OPERATORS(SourceFlag);
30 30
31struct MiiInfo { 31struct MiiInfo {
32 Common::NewUUID uuid; 32 Common::UUID uuid;
33 std::array<char16_t, 11> name; 33 std::array<char16_t, 11> name;
34 u8 font_region; 34 u8 font_region;
35 u8 favorite_color; 35 u8 favorite_color;
@@ -192,7 +192,7 @@ struct MiiStoreData {
192 192
193 MiiStoreData(); 193 MiiStoreData();
194 MiiStoreData(const Name& name, const MiiStoreBitFields& bit_fields, 194 MiiStoreData(const Name& name, const MiiStoreBitFields& bit_fields,
195 const Common::NewUUID& user_id); 195 const Common::UUID& user_id);
196 196
197 // This corresponds to the above structure MiiStoreBitFields. I did it like this because the 197 // This corresponds to the above structure MiiStoreBitFields. I did it like this because the
198 // BitField<> type makes this (and any thing that contains it) not trivially copyable, which is 198 // BitField<> type makes this (and any thing that contains it) not trivially copyable, which is
@@ -202,7 +202,7 @@ struct MiiStoreData {
202 static_assert(sizeof(MiiStoreBitFields) == sizeof(data), "data field has incorrect size."); 202 static_assert(sizeof(MiiStoreBitFields) == sizeof(data), "data field has incorrect size.");
203 203
204 Name name{}; 204 Name name{};
205 Common::NewUUID uuid{}; 205 Common::UUID uuid{};
206 } data; 206 } data;
207 207
208 u16 data_crc{}; 208 u16 data_crc{};
@@ -326,7 +326,7 @@ public:
326 ResultCode GetIndex(const MiiInfo& info, u32& index); 326 ResultCode GetIndex(const MiiInfo& info, u32& index);
327 327
328private: 328private:
329 const Common::NewUUID user_id{}; 329 const Common::UUID user_id{};
330 u64 update_counter{}; 330 u64 update_counter{};
331}; 331};
332 332
diff --git a/src/core/hle/service/ns/pdm_qry.cpp b/src/core/hle/service/ns/pdm_qry.cpp
index 3eda444d2..36ce46353 100644
--- a/src/core/hle/service/ns/pdm_qry.cpp
+++ b/src/core/hle/service/ns/pdm_qry.cpp
@@ -5,7 +5,7 @@
5#include <memory> 5#include <memory>
6 6
7#include "common/logging/log.h" 7#include "common/logging/log.h"
8#include "common/new_uuid.h" 8#include "common/uuid.h"
9#include "core/hle/ipc_helpers.h" 9#include "core/hle/ipc_helpers.h"
10#include "core/hle/service/ns/pdm_qry.h" 10#include "core/hle/service/ns/pdm_qry.h"
11#include "core/hle/service/service.h" 11#include "core/hle/service/service.h"
@@ -49,7 +49,7 @@ void PDM_QRY::QueryPlayStatisticsByApplicationIdAndUserAccountId(Kernel::HLERequ
49 const auto unknown = rp.Pop<bool>(); 49 const auto unknown = rp.Pop<bool>();
50 rp.Pop<u8>(); // Padding 50 rp.Pop<u8>(); // Padding
51 const auto application_id = rp.Pop<u64>(); 51 const auto application_id = rp.Pop<u64>();
52 const auto user_account_uid = rp.PopRaw<Common::NewUUID>(); 52 const auto user_account_uid = rp.PopRaw<Common::UUID>();
53 53
54 // TODO(German77): Read statistics of the game 54 // TODO(German77): Read statistics of the game
55 PlayStatistics statistics{ 55 PlayStatistics statistics{
diff --git a/src/core/hle/service/time/clock_types.h b/src/core/hle/service/time/clock_types.h
index 23d6c859b..d0cacb80c 100644
--- a/src/core/hle/service/time/clock_types.h
+++ b/src/core/hle/service/time/clock_types.h
@@ -6,7 +6,7 @@
6 6
7#include "common/common_funcs.h" 7#include "common/common_funcs.h"
8#include "common/common_types.h" 8#include "common/common_types.h"
9#include "common/new_uuid.h" 9#include "common/uuid.h"
10#include "core/hle/service/time/errors.h" 10#include "core/hle/service/time/errors.h"
11#include "core/hle/service/time/time_zone_types.h" 11#include "core/hle/service/time/time_zone_types.h"
12 12
@@ -21,7 +21,7 @@ enum class TimeType : u8 {
21/// https://switchbrew.org/wiki/Glue_services#SteadyClockTimePoint 21/// https://switchbrew.org/wiki/Glue_services#SteadyClockTimePoint
22struct SteadyClockTimePoint { 22struct SteadyClockTimePoint {
23 s64 time_point; 23 s64 time_point;
24 Common::NewUUID clock_source_id; 24 Common::UUID clock_source_id;
25 25
26 ResultCode GetSpanBetween(SteadyClockTimePoint other, s64& span) const { 26 ResultCode GetSpanBetween(SteadyClockTimePoint other, s64& span) const {
27 span = 0; 27 span = 0;
@@ -36,7 +36,7 @@ struct SteadyClockTimePoint {
36 } 36 }
37 37
38 static SteadyClockTimePoint GetRandom() { 38 static SteadyClockTimePoint GetRandom() {
39 return {0, Common::NewUUID::MakeRandom()}; 39 return {0, Common::UUID::MakeRandom()};
40 } 40 }
41}; 41};
42static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size"); 42static_assert(sizeof(SteadyClockTimePoint) == 0x18, "SteadyClockTimePoint is incorrect size");
@@ -45,7 +45,7 @@ static_assert(std::is_trivially_copyable_v<SteadyClockTimePoint>,
45 45
46struct SteadyClockContext { 46struct SteadyClockContext {
47 u64 internal_offset; 47 u64 internal_offset;
48 Common::NewUUID steady_time_point; 48 Common::UUID steady_time_point;
49}; 49};
50static_assert(sizeof(SteadyClockContext) == 0x18, "SteadyClockContext is incorrect size"); 50static_assert(sizeof(SteadyClockContext) == 0x18, "SteadyClockContext is incorrect size");
51static_assert(std::is_trivially_copyable_v<SteadyClockContext>, 51static_assert(std::is_trivially_copyable_v<SteadyClockContext>,
diff --git a/src/core/hle/service/time/steady_clock_core.h b/src/core/hle/service/time/steady_clock_core.h
index dfc9fade4..5ee2c0e0a 100644
--- a/src/core/hle/service/time/steady_clock_core.h
+++ b/src/core/hle/service/time/steady_clock_core.h
@@ -4,7 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "common/new_uuid.h" 7#include "common/uuid.h"
8#include "core/hle/service/time/clock_types.h" 8#include "core/hle/service/time/clock_types.h"
9 9
10namespace Core { 10namespace Core {
@@ -18,11 +18,11 @@ public:
18 SteadyClockCore() = default; 18 SteadyClockCore() = default;
19 virtual ~SteadyClockCore() = default; 19 virtual ~SteadyClockCore() = default;
20 20
21 const Common::NewUUID& GetClockSourceId() const { 21 const Common::UUID& GetClockSourceId() const {
22 return clock_source_id; 22 return clock_source_id;
23 } 23 }
24 24
25 void SetClockSourceId(const Common::NewUUID& value) { 25 void SetClockSourceId(const Common::UUID& value) {
26 clock_source_id = value; 26 clock_source_id = value;
27 } 27 }
28 28
@@ -49,7 +49,7 @@ public:
49 } 49 }
50 50
51private: 51private:
52 Common::NewUUID clock_source_id{Common::NewUUID::MakeRandom()}; 52 Common::UUID clock_source_id{Common::UUID::MakeRandom()};
53 bool is_initialized{}; 53 bool is_initialized{};
54}; 54};
55 55
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp
index 15a2d99e8..00f1ae8cf 100644
--- a/src/core/hle/service/time/time_manager.cpp
+++ b/src/core/hle/service/time/time_manager.cpp
@@ -45,7 +45,7 @@ struct TimeManager::Impl final {
45 time_zone_content_manager{system} { 45 time_zone_content_manager{system} {
46 46
47 const auto system_time{Clock::TimeSpanType::FromSeconds(GetExternalRtcValue())}; 47 const auto system_time{Clock::TimeSpanType::FromSeconds(GetExternalRtcValue())};
48 SetupStandardSteadyClock(system, Common::NewUUID::MakeRandom(), system_time, {}, {}); 48 SetupStandardSteadyClock(system, Common::UUID::MakeRandom(), system_time, {}, {});
49 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds()); 49 SetupStandardLocalSystemClock(system, {}, system_time.ToSeconds());
50 50
51 Clock::SystemClockContext clock_context{}; 51 Clock::SystemClockContext clock_context{};
@@ -132,7 +132,7 @@ struct TimeManager::Impl final {
132 return 0; 132 return 0;
133 } 133 }
134 134
135 void SetupStandardSteadyClock(Core::System& system_, Common::NewUUID clock_source_id, 135 void SetupStandardSteadyClock(Core::System& system_, Common::UUID clock_source_id,
136 Clock::TimeSpanType setup_value, 136 Clock::TimeSpanType setup_value,
137 Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) { 137 Clock::TimeSpanType internal_offset, bool is_rtc_reset_detected) {
138 standard_steady_clock_core.SetClockSourceId(clock_source_id); 138 standard_steady_clock_core.SetClockSourceId(clock_source_id);
diff --git a/src/core/hle/service/time/time_sharedmemory.cpp b/src/core/hle/service/time/time_sharedmemory.cpp
index ac31cd9ca..ed9f75ed6 100644
--- a/src/core/hle/service/time/time_sharedmemory.cpp
+++ b/src/core/hle/service/time/time_sharedmemory.cpp
@@ -20,7 +20,7 @@ SharedMemory::SharedMemory(Core::System& system_) : system(system_) {
20 20
21SharedMemory::~SharedMemory() = default; 21SharedMemory::~SharedMemory() = default;
22 22
23void SharedMemory::SetupStandardSteadyClock(const Common::NewUUID& clock_source_id, 23void SharedMemory::SetupStandardSteadyClock(const Common::UUID& clock_source_id,
24 Clock::TimeSpanType current_time_point) { 24 Clock::TimeSpanType current_time_point) {
25 const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks( 25 const Clock::TimeSpanType ticks_time_span{Clock::TimeSpanType::FromTicks(
26 system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)}; 26 system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)};
diff --git a/src/core/hle/service/time/time_sharedmemory.h b/src/core/hle/service/time/time_sharedmemory.h
index 4063ce4e0..9307ea795 100644
--- a/src/core/hle/service/time/time_sharedmemory.h
+++ b/src/core/hle/service/time/time_sharedmemory.h
@@ -5,7 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include "common/common_types.h" 7#include "common/common_types.h"
8#include "common/new_uuid.h" 8#include "common/uuid.h"
9#include "core/hle/kernel/k_shared_memory.h" 9#include "core/hle/kernel/k_shared_memory.h"
10#include "core/hle/service/time/clock_types.h" 10#include "core/hle/service/time/clock_types.h"
11 11
@@ -52,7 +52,7 @@ public:
52 }; 52 };
53 static_assert(sizeof(Format) == 0xd8, "Format is an invalid size"); 53 static_assert(sizeof(Format) == 0xd8, "Format is an invalid size");
54 54
55 void SetupStandardSteadyClock(const Common::NewUUID& clock_source_id, 55 void SetupStandardSteadyClock(const Common::UUID& clock_source_id,
56 Clock::TimeSpanType current_time_point); 56 Clock::TimeSpanType current_time_point);
57 void UpdateLocalSystemClockContext(const Clock::SystemClockContext& context); 57 void UpdateLocalSystemClockContext(const Clock::SystemClockContext& context);
58 void UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context); 58 void UpdateNetworkSystemClockContext(const Clock::SystemClockContext& context);
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index 7a269b526..155caae42 100644
--- a/src/input_common/drivers/gc_adapter.cpp
+++ b/src/input_common/drivers/gc_adapter.cpp
@@ -248,7 +248,7 @@ bool GCAdapter::Setup() {
248 std::size_t port = 0; 248 std::size_t port = 0;
249 for (GCController& pad : pads) { 249 for (GCController& pad : pads) {
250 pad.identifier = { 250 pad.identifier = {
251 .guid = Common::NewUUID{}, 251 .guid = Common::UUID{},
252 .port = port++, 252 .port = port++,
253 .pad = 0, 253 .pad = 0,
254 }; 254 };
diff --git a/src/input_common/drivers/keyboard.cpp b/src/input_common/drivers/keyboard.cpp
index 449509270..59e3d9cc0 100644
--- a/src/input_common/drivers/keyboard.cpp
+++ b/src/input_common/drivers/keyboard.cpp
@@ -9,17 +9,17 @@
9namespace InputCommon { 9namespace InputCommon {
10 10
11constexpr PadIdentifier key_identifier = { 11constexpr PadIdentifier key_identifier = {
12 .guid = Common::NewUUID{}, 12 .guid = Common::UUID{},
13 .port = 0, 13 .port = 0,
14 .pad = 0, 14 .pad = 0,
15}; 15};
16constexpr PadIdentifier keyboard_key_identifier = { 16constexpr PadIdentifier keyboard_key_identifier = {
17 .guid = Common::NewUUID{}, 17 .guid = Common::UUID{},
18 .port = 1, 18 .port = 1,
19 .pad = 0, 19 .pad = 0,
20}; 20};
21constexpr PadIdentifier keyboard_modifier_identifier = { 21constexpr PadIdentifier keyboard_modifier_identifier = {
22 .guid = Common::NewUUID{}, 22 .guid = Common::UUID{},
23 .port = 1, 23 .port = 1,
24 .pad = 1, 24 .pad = 1,
25}; 25};
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp
index ae63088ba..3c9a4e747 100644
--- a/src/input_common/drivers/mouse.cpp
+++ b/src/input_common/drivers/mouse.cpp
@@ -20,7 +20,7 @@ constexpr int motion_wheel_y = 4;
20constexpr int touch_axis_x = 10; 20constexpr int touch_axis_x = 10;
21constexpr int touch_axis_y = 11; 21constexpr int touch_axis_y = 11;
22constexpr PadIdentifier identifier = { 22constexpr PadIdentifier identifier = {
23 .guid = Common::NewUUID{}, 23 .guid = Common::UUID{},
24 .port = 0, 24 .port = 0,
25 .pad = 0, 25 .pad = 0,
26}; 26};
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp
index b9a8317d4..655eb5275 100644
--- a/src/input_common/drivers/sdl_driver.cpp
+++ b/src/input_common/drivers/sdl_driver.cpp
@@ -120,7 +120,7 @@ public:
120 */ 120 */
121 const PadIdentifier GetPadIdentifier() const { 121 const PadIdentifier GetPadIdentifier() const {
122 return { 122 return {
123 .guid = Common::NewUUID{guid}, 123 .guid = Common::UUID{guid},
124 .port = static_cast<std::size_t>(port), 124 .port = static_cast<std::size_t>(port),
125 .pad = 0, 125 .pad = 0,
126 }; 126 };
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index 6d36cf5da..944e141bf 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -50,7 +50,7 @@ constexpr std::array<std::pair<std::string_view, TasButton>, 18> text_to_tas_but
50Tas::Tas(std::string input_engine_) : InputEngine(std::move(input_engine_)) { 50Tas::Tas(std::string input_engine_) : InputEngine(std::move(input_engine_)) {
51 for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) { 51 for (size_t player_index = 0; player_index < PLAYER_NUMBER; player_index++) {
52 PadIdentifier identifier{ 52 PadIdentifier identifier{
53 .guid = Common::NewUUID{}, 53 .guid = Common::UUID{},
54 .port = player_index, 54 .port = player_index,
55 .pad = 0, 55 .pad = 0,
56 }; 56 };
@@ -203,7 +203,7 @@ void Tas::UpdateThread() {
203 } 203 }
204 204
205 PadIdentifier identifier{ 205 PadIdentifier identifier{
206 .guid = Common::NewUUID{}, 206 .guid = Common::UUID{},
207 .port = player_index, 207 .port = player_index,
208 .pad = 0, 208 .pad = 0,
209 }; 209 };
diff --git a/src/input_common/drivers/touch_screen.cpp b/src/input_common/drivers/touch_screen.cpp
index 1030e74d9..30c727df4 100644
--- a/src/input_common/drivers/touch_screen.cpp
+++ b/src/input_common/drivers/touch_screen.cpp
@@ -8,7 +8,7 @@
8namespace InputCommon { 8namespace InputCommon {
9 9
10constexpr PadIdentifier identifier = { 10constexpr PadIdentifier identifier = {
11 .guid = Common::NewUUID{}, 11 .guid = Common::UUID{},
12 .port = 0, 12 .port = 0,
13 .pad = 0, 13 .pad = 0,
14}; 14};
diff --git a/src/input_common/drivers/udp_client.cpp b/src/input_common/drivers/udp_client.cpp
index cbcfa7a4b..64162f431 100644
--- a/src/input_common/drivers/udp_client.cpp
+++ b/src/input_common/drivers/udp_client.cpp
@@ -351,10 +351,10 @@ PadIdentifier UDPClient::GetPadIdentifier(std::size_t pad_index) const {
351 }; 351 };
352} 352}
353 353
354Common::NewUUID UDPClient::GetHostUUID(const std::string& host) const { 354Common::UUID UDPClient::GetHostUUID(const std::string& host) const {
355 const auto ip = boost::asio::ip::make_address_v4(host); 355 const auto ip = boost::asio::ip::make_address_v4(host);
356 const auto hex_host = fmt::format("00000000-0000-0000-0000-0000{:06x}", ip.to_uint()); 356 const auto hex_host = fmt::format("00000000-0000-0000-0000-0000{:06x}", ip.to_uint());
357 return Common::NewUUID{hex_host}; 357 return Common::UUID{hex_host};
358} 358}
359 359
360void UDPClient::Reset() { 360void UDPClient::Reset() {
diff --git a/src/input_common/drivers/udp_client.h b/src/input_common/drivers/udp_client.h
index 98abeedd1..76e32bd04 100644
--- a/src/input_common/drivers/udp_client.h
+++ b/src/input_common/drivers/udp_client.h
@@ -126,7 +126,7 @@ private:
126 struct ClientConnection { 126 struct ClientConnection {
127 ClientConnection(); 127 ClientConnection();
128 ~ClientConnection(); 128 ~ClientConnection();
129 Common::NewUUID uuid{"00000000-0000-0000-0000-00007F000001"}; 129 Common::UUID uuid{"00000000-0000-0000-0000-00007F000001"};
130 std::string host{"127.0.0.1"}; 130 std::string host{"127.0.0.1"};
131 u16 port{26760}; 131 u16 port{26760};
132 s8 active{-1}; 132 s8 active{-1};
@@ -148,7 +148,7 @@ private:
148 void OnPadData(Response::PadData, std::size_t client); 148 void OnPadData(Response::PadData, std::size_t client);
149 void StartCommunication(std::size_t client, const std::string& host, u16 port); 149 void StartCommunication(std::size_t client, const std::string& host, u16 port);
150 PadIdentifier GetPadIdentifier(std::size_t pad_index) const; 150 PadIdentifier GetPadIdentifier(std::size_t pad_index) const;
151 Common::NewUUID GetHostUUID(const std::string& host) const; 151 Common::UUID GetHostUUID(const std::string& host) const;
152 152
153 Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const; 153 Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const;
154 154
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h
index 05e45b877..c6c027aef 100644
--- a/src/input_common/input_engine.h
+++ b/src/input_common/input_engine.h
@@ -10,13 +10,13 @@
10 10
11#include "common/common_types.h" 11#include "common/common_types.h"
12#include "common/input.h" 12#include "common/input.h"
13#include "common/new_uuid.h"
14#include "common/param_package.h" 13#include "common/param_package.h"
14#include "common/uuid.h"
15#include "input_common/main.h" 15#include "input_common/main.h"
16 16
17// Pad Identifier of data source 17// Pad Identifier of data source
18struct PadIdentifier { 18struct PadIdentifier {
19 Common::NewUUID guid{}; 19 Common::UUID guid{};
20 std::size_t port{}; 20 std::size_t port{};
21 std::size_t pad{}; 21 std::size_t pad{};
22 22
diff --git a/src/input_common/input_poller.cpp b/src/input_common/input_poller.cpp
index 313703f5f..2f3c0735a 100644
--- a/src/input_common/input_poller.cpp
+++ b/src/input_common/input_poller.cpp
@@ -691,7 +691,7 @@ private:
691std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateButtonDevice( 691std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateButtonDevice(
692 const Common::ParamPackage& params) { 692 const Common::ParamPackage& params) {
693 const PadIdentifier identifier = { 693 const PadIdentifier identifier = {
694 .guid = Common::NewUUID{params.Get("guid", "")}, 694 .guid = Common::UUID{params.Get("guid", "")},
695 .port = static_cast<std::size_t>(params.Get("port", 0)), 695 .port = static_cast<std::size_t>(params.Get("port", 0)),
696 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 696 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
697 }; 697 };
@@ -714,7 +714,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateButtonDevice(
714std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateHatButtonDevice( 714std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateHatButtonDevice(
715 const Common::ParamPackage& params) { 715 const Common::ParamPackage& params) {
716 const PadIdentifier identifier = { 716 const PadIdentifier identifier = {
717 .guid = Common::NewUUID{params.Get("guid", "")}, 717 .guid = Common::UUID{params.Get("guid", "")},
718 .port = static_cast<std::size_t>(params.Get("port", 0)), 718 .port = static_cast<std::size_t>(params.Get("port", 0)),
719 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 719 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
720 }; 720 };
@@ -736,7 +736,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateStickDevice(
736 const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f); 736 const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f);
737 const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f); 737 const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f);
738 const PadIdentifier identifier = { 738 const PadIdentifier identifier = {
739 .guid = Common::NewUUID{params.Get("guid", "")}, 739 .guid = Common::UUID{params.Get("guid", "")},
740 .port = static_cast<std::size_t>(params.Get("port", 0)), 740 .port = static_cast<std::size_t>(params.Get("port", 0)),
741 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 741 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
742 }; 742 };
@@ -768,7 +768,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateStickDevice(
768std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice( 768std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice(
769 const Common::ParamPackage& params) { 769 const Common::ParamPackage& params) {
770 const PadIdentifier identifier = { 770 const PadIdentifier identifier = {
771 .guid = Common::NewUUID{params.Get("guid", "")}, 771 .guid = Common::UUID{params.Get("guid", "")},
772 .port = static_cast<std::size_t>(params.Get("port", 0)), 772 .port = static_cast<std::size_t>(params.Get("port", 0)),
773 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 773 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
774 }; 774 };
@@ -789,7 +789,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateAnalogDevice(
789std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTriggerDevice( 789std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTriggerDevice(
790 const Common::ParamPackage& params) { 790 const Common::ParamPackage& params) {
791 const PadIdentifier identifier = { 791 const PadIdentifier identifier = {
792 .guid = Common::NewUUID{params.Get("guid", "")}, 792 .guid = Common::UUID{params.Get("guid", "")},
793 .port = static_cast<std::size_t>(params.Get("port", 0)), 793 .port = static_cast<std::size_t>(params.Get("port", 0)),
794 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 794 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
795 }; 795 };
@@ -820,7 +820,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTouchDevice(
820 const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f); 820 const auto range = std::clamp(params.Get("range", 1.0f), 0.25f, 1.50f);
821 const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f); 821 const auto threshold = std::clamp(params.Get("threshold", 0.5f), 0.0f, 1.0f);
822 const PadIdentifier identifier = { 822 const PadIdentifier identifier = {
823 .guid = Common::NewUUID{params.Get("guid", "")}, 823 .guid = Common::UUID{params.Get("guid", "")},
824 .port = static_cast<std::size_t>(params.Get("port", 0)), 824 .port = static_cast<std::size_t>(params.Get("port", 0)),
825 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 825 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
826 }; 826 };
@@ -857,7 +857,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateTouchDevice(
857std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateBatteryDevice( 857std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateBatteryDevice(
858 const Common::ParamPackage& params) { 858 const Common::ParamPackage& params) {
859 const PadIdentifier identifier = { 859 const PadIdentifier identifier = {
860 .guid = Common::NewUUID{params.Get("guid", "")}, 860 .guid = Common::UUID{params.Get("guid", "")},
861 .port = static_cast<std::size_t>(params.Get("port", 0)), 861 .port = static_cast<std::size_t>(params.Get("port", 0)),
862 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 862 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
863 }; 863 };
@@ -869,7 +869,7 @@ std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateBatteryDevice(
869std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateMotionDevice( 869std::unique_ptr<Common::Input::InputDevice> InputFactory::CreateMotionDevice(
870 Common::ParamPackage params) { 870 Common::ParamPackage params) {
871 const PadIdentifier identifier = { 871 const PadIdentifier identifier = {
872 .guid = Common::NewUUID{params.Get("guid", "")}, 872 .guid = Common::UUID{params.Get("guid", "")},
873 .port = static_cast<std::size_t>(params.Get("port", 0)), 873 .port = static_cast<std::size_t>(params.Get("port", 0)),
874 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 874 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
875 }; 875 };
@@ -963,7 +963,7 @@ OutputFactory::OutputFactory(std::shared_ptr<InputEngine> input_engine_)
963std::unique_ptr<Common::Input::OutputDevice> OutputFactory::Create( 963std::unique_ptr<Common::Input::OutputDevice> OutputFactory::Create(
964 const Common::ParamPackage& params) { 964 const Common::ParamPackage& params) {
965 const PadIdentifier identifier = { 965 const PadIdentifier identifier = {
966 .guid = Common::NewUUID{params.Get("guid", "")}, 966 .guid = Common::UUID{params.Get("guid", "")},
967 .port = static_cast<std::size_t>(params.Get("port", 0)), 967 .port = static_cast<std::size_t>(params.Get("port", 0)),
968 .pad = static_cast<std::size_t>(params.Get("pad", 0)), 968 .pad = static_cast<std::size_t>(params.Get("pad", 0)),
969 }; 969 };
diff --git a/src/yuzu/applets/qt_profile_select.cpp b/src/yuzu/applets/qt_profile_select.cpp
index c10185e50..4cd8f7784 100644
--- a/src/yuzu/applets/qt_profile_select.cpp
+++ b/src/yuzu/applets/qt_profile_select.cpp
@@ -19,21 +19,21 @@
19#include "yuzu/util/controller_navigation.h" 19#include "yuzu/util/controller_navigation.h"
20 20
21namespace { 21namespace {
22QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { 22QString FormatUserEntryText(const QString& username, Common::UUID uuid) {
23 return QtProfileSelectionDialog::tr( 23 return QtProfileSelectionDialog::tr(
24 "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. " 24 "%1\n%2", "%1 is the profile username, %2 is the formatted UUID (e.g. "
25 "00112233-4455-6677-8899-AABBCCDDEEFF))") 25 "00112233-4455-6677-8899-AABBCCDDEEFF))")
26 .arg(username, QString::fromStdString(uuid.FormattedString())); 26 .arg(username, QString::fromStdString(uuid.FormattedString()));
27} 27}
28 28
29QString GetImagePath(Common::NewUUID uuid) { 29QString GetImagePath(Common::UUID uuid) {
30 const auto path = 30 const auto path =
31 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / 31 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
32 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); 32 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
33 return QString::fromStdString(Common::FS::PathToUTF8String(path)); 33 return QString::fromStdString(Common::FS::PathToUTF8String(path));
34} 34}
35 35
36QPixmap GetIcon(Common::NewUUID uuid) { 36QPixmap GetIcon(Common::UUID uuid) {
37 QPixmap icon{GetImagePath(uuid)}; 37 QPixmap icon{GetImagePath(uuid)};
38 38
39 if (!icon) { 39 if (!icon) {
@@ -163,11 +163,11 @@ QtProfileSelector::QtProfileSelector(GMainWindow& parent) {
163QtProfileSelector::~QtProfileSelector() = default; 163QtProfileSelector::~QtProfileSelector() = default;
164 164
165void QtProfileSelector::SelectProfile( 165void QtProfileSelector::SelectProfile(
166 std::function<void(std::optional<Common::NewUUID>)> callback_) const { 166 std::function<void(std::optional<Common::UUID>)> callback_) const {
167 callback = std::move(callback_); 167 callback = std::move(callback_);
168 emit MainWindowSelectProfile(); 168 emit MainWindowSelectProfile();
169} 169}
170 170
171void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid) { 171void QtProfileSelector::MainWindowFinishedSelection(std::optional<Common::UUID> uuid) {
172 callback(uuid); 172 callback(uuid);
173} 173}
diff --git a/src/yuzu/applets/qt_profile_select.h b/src/yuzu/applets/qt_profile_select.h
index 2522b6450..56496ed31 100644
--- a/src/yuzu/applets/qt_profile_select.h
+++ b/src/yuzu/applets/qt_profile_select.h
@@ -66,14 +66,13 @@ public:
66 explicit QtProfileSelector(GMainWindow& parent); 66 explicit QtProfileSelector(GMainWindow& parent);
67 ~QtProfileSelector() override; 67 ~QtProfileSelector() override;
68 68
69 void SelectProfile( 69 void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback_) const override;
70 std::function<void(std::optional<Common::NewUUID>)> callback_) const override;
71 70
72signals: 71signals:
73 void MainWindowSelectProfile() const; 72 void MainWindowSelectProfile() const;
74 73
75private: 74private:
76 void MainWindowFinishedSelection(std::optional<Common::NewUUID> uuid); 75 void MainWindowFinishedSelection(std::optional<Common::UUID> uuid);
77 76
78 mutable std::function<void(std::optional<Common::NewUUID>)> callback; 77 mutable std::function<void(std::optional<Common::UUID>)> callback;
79}; 78};
diff --git a/src/yuzu/configuration/configure_profile_manager.cpp b/src/yuzu/configuration/configure_profile_manager.cpp
index 9e2832543..d9f6dee4e 100644
--- a/src/yuzu/configuration/configure_profile_manager.cpp
+++ b/src/yuzu/configuration/configure_profile_manager.cpp
@@ -33,14 +33,14 @@ constexpr std::array<u8, 107> backup_jpeg{
33 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9, 33 0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9,
34}; 34};
35 35
36QString GetImagePath(const Common::NewUUID& uuid) { 36QString GetImagePath(const Common::UUID& uuid) {
37 const auto path = 37 const auto path =
38 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / 38 Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) /
39 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString()); 39 fmt::format("system/save/8000000000000010/su/avators/{}.jpg", uuid.FormattedString());
40 return QString::fromStdString(Common::FS::PathToUTF8String(path)); 40 return QString::fromStdString(Common::FS::PathToUTF8String(path));
41} 41}
42 42
43QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::NewUUID uuid) { 43QString GetAccountUsername(const Service::Account::ProfileManager& manager, Common::UUID uuid) {
44 Service::Account::ProfileBase profile{}; 44 Service::Account::ProfileBase profile{};
45 if (!manager.GetProfileBase(uuid, profile)) { 45 if (!manager.GetProfileBase(uuid, profile)) {
46 return {}; 46 return {};
@@ -51,14 +51,14 @@ QString GetAccountUsername(const Service::Account::ProfileManager& manager, Comm
51 return QString::fromStdString(text); 51 return QString::fromStdString(text);
52} 52}
53 53
54QString FormatUserEntryText(const QString& username, Common::NewUUID uuid) { 54QString FormatUserEntryText(const QString& username, Common::UUID uuid) {
55 return ConfigureProfileManager::tr("%1\n%2", 55 return ConfigureProfileManager::tr("%1\n%2",
56 "%1 is the profile username, %2 is the formatted UUID (e.g. " 56 "%1 is the profile username, %2 is the formatted UUID (e.g. "
57 "00112233-4455-6677-8899-AABBCCDDEEFF))") 57 "00112233-4455-6677-8899-AABBCCDDEEFF))")
58 .arg(username, QString::fromStdString(uuid.FormattedString())); 58 .arg(username, QString::fromStdString(uuid.FormattedString()));
59} 59}
60 60
61QPixmap GetIcon(const Common::NewUUID& uuid) { 61QPixmap GetIcon(const Common::UUID& uuid) {
62 QPixmap icon{GetImagePath(uuid)}; 62 QPixmap icon{GetImagePath(uuid)};
63 63
64 if (!icon) { 64 if (!icon) {
@@ -200,7 +200,7 @@ void ConfigureProfileManager::AddUser() {
200 return; 200 return;
201 } 201 }
202 202
203 const auto uuid = Common::NewUUID::MakeRandom(); 203 const auto uuid = Common::UUID::MakeRandom();
204 profile_manager->CreateNewUser(uuid, username.toStdString()); 204 profile_manager->CreateNewUser(uuid, username.toStdString());
205 205
206 item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)}); 206 item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)});
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 529d101ae..ca4ab9af5 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -153,7 +153,7 @@ signals:
153 153
154 void ErrorDisplayFinished(); 154 void ErrorDisplayFinished();
155 155
156 void ProfileSelectorFinishedSelection(std::optional<Common::NewUUID> uuid); 156 void ProfileSelectorFinishedSelection(std::optional<Common::UUID> uuid);
157 157
158 void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result, 158 void SoftwareKeyboardSubmitNormalText(Service::AM::Applets::SwkbdResult result,
159 std::u16string submitted_text, bool confirmed); 159 std::u16string submitted_text, bool confirmed);