mii_manager.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. // Copyright 2020 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <cstring>
  5. #include <random>
  6. #include "common/assert.h"
  7. #include "common/logging/log.h"
  8. #include "common/string_util.h"
  9. #include "core/hle/service/acc/profile_manager.h"
  10. #include "core/hle/service/mii/mii_manager.h"
  11. #include "core/hle/service/mii/raw_data.h"
  12. #include "core/hle/service/mii/types.h"
  13. namespace Service::Mii {
  14. namespace {
  15. constexpr ResultCode ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4};
  16. constexpr std::size_t BaseMiiCount{2};
  17. constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()};
  18. constexpr MiiStoreData::Name DefaultMiiName{u'y', u'u', u'z', u'u'};
  19. constexpr std::array<u8, 8> HairColorLookup{8, 1, 2, 3, 4, 5, 6, 7};
  20. constexpr std::array<u8, 6> EyeColorLookup{8, 9, 10, 11, 12, 13};
  21. constexpr std::array<u8, 5> MouthColorLookup{19, 20, 21, 22, 23};
  22. constexpr std::array<u8, 7> GlassesColorLookup{8, 14, 15, 16, 17, 18, 0};
  23. constexpr std::array<u8, 62> EyeRotateLookup{
  24. {0x03, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04,
  25. 0x04, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x03, 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04,
  26. 0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03,
  27. 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x03, 0x04, 0x04}};
  28. constexpr std::array<u8, 24> EyebrowRotateLookup{{0x06, 0x06, 0x05, 0x07, 0x06, 0x07, 0x06, 0x07,
  29. 0x04, 0x07, 0x06, 0x08, 0x05, 0x05, 0x06, 0x06,
  30. 0x07, 0x07, 0x06, 0x06, 0x05, 0x06, 0x07, 0x05}};
  31. template <typename T, std::size_t SourceArraySize, std::size_t DestArraySize>
  32. std::array<T, DestArraySize> ResizeArray(const std::array<T, SourceArraySize>& in) {
  33. std::array<T, DestArraySize> out{};
  34. std::memcpy(out.data(), in.data(), sizeof(T) * std::min(SourceArraySize, DestArraySize));
  35. return out;
  36. }
  37. MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) {
  38. MiiStoreBitFields bf;
  39. std::memcpy(&bf, data.data.data.data(), sizeof(MiiStoreBitFields));
  40. return {
  41. .uuid = data.data.uuid,
  42. .name = ResizeArray<char16_t, 10, 11>(data.data.name),
  43. .font_region = static_cast<u8>(bf.font_region.Value()),
  44. .favorite_color = static_cast<u8>(bf.favorite_color.Value()),
  45. .gender = static_cast<u8>(bf.gender.Value()),
  46. .height = static_cast<u8>(bf.height.Value()),
  47. .build = static_cast<u8>(bf.build.Value()),
  48. .type = static_cast<u8>(bf.type.Value()),
  49. .region_move = static_cast<u8>(bf.region_move.Value()),
  50. .faceline_type = static_cast<u8>(bf.faceline_type.Value()),
  51. .faceline_color = static_cast<u8>(bf.faceline_color.Value()),
  52. .faceline_wrinkle = static_cast<u8>(bf.faceline_wrinkle.Value()),
  53. .faceline_make = static_cast<u8>(bf.faceline_makeup.Value()),
  54. .hair_type = static_cast<u8>(bf.hair_type.Value()),
  55. .hair_color = static_cast<u8>(bf.hair_color.Value()),
  56. .hair_flip = static_cast<u8>(bf.hair_flip.Value()),
  57. .eye_type = static_cast<u8>(bf.eye_type.Value()),
  58. .eye_color = static_cast<u8>(bf.eye_color.Value()),
  59. .eye_scale = static_cast<u8>(bf.eye_scale.Value()),
  60. .eye_aspect = static_cast<u8>(bf.eye_aspect.Value()),
  61. .eye_rotate = static_cast<u8>(bf.eye_rotate.Value()),
  62. .eye_x = static_cast<u8>(bf.eye_x.Value()),
  63. .eye_y = static_cast<u8>(bf.eye_y.Value()),
  64. .eyebrow_type = static_cast<u8>(bf.eyebrow_type.Value()),
  65. .eyebrow_color = static_cast<u8>(bf.eyebrow_color.Value()),
  66. .eyebrow_scale = static_cast<u8>(bf.eyebrow_scale.Value()),
  67. .eyebrow_aspect = static_cast<u8>(bf.eyebrow_aspect.Value()),
  68. .eyebrow_rotate = static_cast<u8>(bf.eyebrow_rotate.Value()),
  69. .eyebrow_x = static_cast<u8>(bf.eyebrow_x.Value()),
  70. .eyebrow_y = static_cast<u8>(bf.eyebrow_y.Value() + 3),
  71. .nose_type = static_cast<u8>(bf.nose_type.Value()),
  72. .nose_scale = static_cast<u8>(bf.nose_scale.Value()),
  73. .nose_y = static_cast<u8>(bf.nose_y.Value()),
  74. .mouth_type = static_cast<u8>(bf.mouth_type.Value()),
  75. .mouth_color = static_cast<u8>(bf.mouth_color.Value()),
  76. .mouth_scale = static_cast<u8>(bf.mouth_scale.Value()),
  77. .mouth_aspect = static_cast<u8>(bf.mouth_aspect.Value()),
  78. .mouth_y = static_cast<u8>(bf.mouth_y.Value()),
  79. .beard_color = static_cast<u8>(bf.beard_color.Value()),
  80. .beard_type = static_cast<u8>(bf.beard_type.Value()),
  81. .mustache_type = static_cast<u8>(bf.mustache_type.Value()),
  82. .mustache_scale = static_cast<u8>(bf.mustache_scale.Value()),
  83. .mustache_y = static_cast<u8>(bf.mustache_y.Value()),
  84. .glasses_type = static_cast<u8>(bf.glasses_type.Value()),
  85. .glasses_color = static_cast<u8>(bf.glasses_color.Value()),
  86. .glasses_scale = static_cast<u8>(bf.glasses_scale.Value()),
  87. .glasses_y = static_cast<u8>(bf.glasses_y.Value()),
  88. .mole_type = static_cast<u8>(bf.mole_type.Value()),
  89. .mole_scale = static_cast<u8>(bf.mole_scale.Value()),
  90. .mole_x = static_cast<u8>(bf.mole_x.Value()),
  91. .mole_y = static_cast<u8>(bf.mole_y.Value()),
  92. .padding = 0,
  93. };
  94. }
  95. u16 GenerateCrc16(const void* data, std::size_t size) {
  96. s32 crc{};
  97. for (std::size_t i = 0; i < size; i++) {
  98. crc ^= static_cast<const u8*>(data)[i] << 8;
  99. for (std::size_t j = 0; j < 8; j++) {
  100. crc <<= 1;
  101. if ((crc & 0x10000) != 0) {
  102. crc = (crc ^ 0x1021) & 0xFFFF;
  103. }
  104. }
  105. }
  106. return Common::swap16(static_cast<u16>(crc));
  107. }
  108. template <typename T>
  109. T GetRandomValue(T min, T max) {
  110. std::random_device device;
  111. std::mt19937 gen(device());
  112. std::uniform_int_distribution<u64> distribution(static_cast<u64>(min), static_cast<u64>(max));
  113. return static_cast<T>(distribution(gen));
  114. }
  115. template <typename T>
  116. T GetRandomValue(T max) {
  117. return GetRandomValue<T>({}, max);
  118. }
  119. MiiStoreData BuildRandomStoreData(Age age, Gender gender, Race race,
  120. const Common::NewUUID& user_id) {
  121. MiiStoreBitFields bf{};
  122. if (gender == Gender::All) {
  123. gender = GetRandomValue<Gender>(Gender::Maximum);
  124. }
  125. bf.gender.Assign(gender);
  126. bf.favorite_color.Assign(GetRandomValue<u8>(11));
  127. bf.region_move.Assign(0);
  128. bf.font_region.Assign(FontRegion::Standard);
  129. bf.type.Assign(0);
  130. bf.height.Assign(64);
  131. bf.build.Assign(64);
  132. if (age == Age::All) {
  133. const auto temp{GetRandomValue<int>(10)};
  134. if (temp >= 8) {
  135. age = Age::Old;
  136. } else if (temp >= 4) {
  137. age = Age::Normal;
  138. } else {
  139. age = Age::Young;
  140. }
  141. }
  142. if (race == Race::All) {
  143. const auto temp{GetRandomValue<int>(10)};
  144. if (temp >= 8) {
  145. race = Race::Black;
  146. } else if (temp >= 4) {
  147. race = Race::White;
  148. } else {
  149. race = Race::Asian;
  150. }
  151. }
  152. u32 axis_y{};
  153. if (gender == Gender::Female && age == Age::Young) {
  154. axis_y = GetRandomValue<u32>(3);
  155. }
  156. const std::size_t index{3 * static_cast<std::size_t>(age) +
  157. 9 * static_cast<std::size_t>(gender) + static_cast<std::size_t>(race)};
  158. const auto faceline_type_info{RawData::RandomMiiFaceline.at(index)};
  159. const auto faceline_color_info{RawData::RandomMiiFacelineColor.at(
  160. 3 * static_cast<std::size_t>(gender) + static_cast<std::size_t>(race))};
  161. const auto faceline_wrinkle_info{RawData::RandomMiiFacelineWrinkle.at(index)};
  162. const auto faceline_makeup_info{RawData::RandomMiiFacelineMakeup.at(index)};
  163. const auto hair_type_info{RawData::RandomMiiHairType.at(index)};
  164. const auto hair_color_info{RawData::RandomMiiHairColor.at(3 * static_cast<std::size_t>(race) +
  165. static_cast<std::size_t>(age))};
  166. const auto eye_type_info{RawData::RandomMiiEyeType.at(index)};
  167. const auto eye_color_info{RawData::RandomMiiEyeColor.at(static_cast<std::size_t>(race))};
  168. const auto eyebrow_type_info{RawData::RandomMiiEyebrowType.at(index)};
  169. const auto nose_type_info{RawData::RandomMiiNoseType.at(index)};
  170. const auto mouth_type_info{RawData::RandomMiiMouthType.at(index)};
  171. const auto glasses_type_info{RawData::RandomMiiGlassType.at(static_cast<std::size_t>(age))};
  172. bf.faceline_type.Assign(
  173. faceline_type_info.values[GetRandomValue<std::size_t>(faceline_type_info.values_count)]);
  174. bf.faceline_color.Assign(
  175. faceline_color_info.values[GetRandomValue<std::size_t>(faceline_color_info.values_count)]);
  176. bf.faceline_wrinkle.Assign(
  177. faceline_wrinkle_info
  178. .values[GetRandomValue<std::size_t>(faceline_wrinkle_info.values_count)]);
  179. bf.faceline_makeup.Assign(
  180. faceline_makeup_info
  181. .values[GetRandomValue<std::size_t>(faceline_makeup_info.values_count)]);
  182. bf.hair_type.Assign(
  183. hair_type_info.values[GetRandomValue<std::size_t>(hair_type_info.values_count)]);
  184. bf.hair_color.Assign(
  185. HairColorLookup[hair_color_info
  186. .values[GetRandomValue<std::size_t>(hair_color_info.values_count)]]);
  187. bf.hair_flip.Assign(GetRandomValue<HairFlip>(HairFlip::Maximum));
  188. bf.eye_type.Assign(
  189. eye_type_info.values[GetRandomValue<std::size_t>(eye_type_info.values_count)]);
  190. const auto eye_rotate_1{gender != Gender::Male ? 4 : 2};
  191. const auto eye_rotate_2{gender != Gender::Male ? 3 : 4};
  192. const auto eye_rotate_offset{32 - EyeRotateLookup[eye_rotate_1] + eye_rotate_2};
  193. const auto eye_rotate{32 - EyeRotateLookup[bf.eye_type]};
  194. bf.eye_color.Assign(
  195. EyeColorLookup[eye_color_info
  196. .values[GetRandomValue<std::size_t>(eye_color_info.values_count)]]);
  197. bf.eye_scale.Assign(4);
  198. bf.eye_aspect.Assign(3);
  199. bf.eye_rotate.Assign(eye_rotate_offset - eye_rotate);
  200. bf.eye_x.Assign(2);
  201. bf.eye_y.Assign(axis_y + 12);
  202. bf.eyebrow_type.Assign(
  203. eyebrow_type_info.values[GetRandomValue<std::size_t>(eyebrow_type_info.values_count)]);
  204. const auto eyebrow_rotate_1{race == Race::Asian ? 6 : 0};
  205. const auto eyebrow_y{race == Race::Asian ? 9 : 10};
  206. const auto eyebrow_rotate_offset{32 - EyebrowRotateLookup[eyebrow_rotate_1] + 6};
  207. const auto eyebrow_rotate{
  208. 32 - EyebrowRotateLookup[static_cast<std::size_t>(bf.eyebrow_type.Value())]};
  209. bf.eyebrow_color.Assign(bf.hair_color);
  210. bf.eyebrow_scale.Assign(4);
  211. bf.eyebrow_aspect.Assign(3);
  212. bf.eyebrow_rotate.Assign(eyebrow_rotate_offset - eyebrow_rotate);
  213. bf.eyebrow_x.Assign(2);
  214. bf.eyebrow_y.Assign(axis_y + eyebrow_y);
  215. const auto nose_scale{gender == Gender::Female ? 3 : 4};
  216. bf.nose_type.Assign(
  217. nose_type_info.values[GetRandomValue<std::size_t>(nose_type_info.values_count)]);
  218. bf.nose_scale.Assign(nose_scale);
  219. bf.nose_y.Assign(axis_y + 9);
  220. const auto mouth_color{gender == Gender::Female ? GetRandomValue<int>(4) : 0};
  221. bf.mouth_type.Assign(
  222. mouth_type_info.values[GetRandomValue<std::size_t>(mouth_type_info.values_count)]);
  223. bf.mouth_color.Assign(MouthColorLookup[mouth_color]);
  224. bf.mouth_scale.Assign(4);
  225. bf.mouth_aspect.Assign(3);
  226. bf.mouth_y.Assign(axis_y + 13);
  227. bf.beard_color.Assign(bf.hair_color);
  228. bf.mustache_scale.Assign(4);
  229. if (gender == Gender::Male && age != Age::Young && GetRandomValue<int>(10) < 2) {
  230. const auto mustache_and_beard_flag{
  231. GetRandomValue<BeardAndMustacheFlag>(BeardAndMustacheFlag::All)};
  232. auto beard_type{BeardType::None};
  233. auto mustache_type{MustacheType::None};
  234. if ((mustache_and_beard_flag & BeardAndMustacheFlag::Beard) ==
  235. BeardAndMustacheFlag::Beard) {
  236. beard_type = GetRandomValue<BeardType>(BeardType::Beard1, BeardType::Beard5);
  237. }
  238. if ((mustache_and_beard_flag & BeardAndMustacheFlag::Mustache) ==
  239. BeardAndMustacheFlag::Mustache) {
  240. mustache_type =
  241. GetRandomValue<MustacheType>(MustacheType::Mustache1, MustacheType::Mustache5);
  242. }
  243. bf.mustache_type.Assign(mustache_type);
  244. bf.beard_type.Assign(beard_type);
  245. bf.mustache_y.Assign(10);
  246. } else {
  247. bf.mustache_type.Assign(MustacheType::None);
  248. bf.beard_type.Assign(BeardType::None);
  249. bf.mustache_y.Assign(axis_y + 10);
  250. }
  251. const auto glasses_type_start{GetRandomValue<std::size_t>(100)};
  252. u8 glasses_type{};
  253. while (glasses_type_start < glasses_type_info.values[glasses_type]) {
  254. if (++glasses_type >= glasses_type_info.values_count) {
  255. UNREACHABLE();
  256. break;
  257. }
  258. }
  259. bf.glasses_type.Assign(glasses_type);
  260. bf.glasses_color.Assign(GlassesColorLookup[0]);
  261. bf.glasses_scale.Assign(4);
  262. bf.glasses_y.Assign(axis_y + 10);
  263. bf.mole_type.Assign(0);
  264. bf.mole_scale.Assign(4);
  265. bf.mole_x.Assign(2);
  266. bf.mole_y.Assign(20);
  267. return {DefaultMiiName, bf, user_id};
  268. }
  269. MiiStoreData BuildDefaultStoreData(const DefaultMii& info, const Common::NewUUID& user_id) {
  270. MiiStoreBitFields bf{};
  271. bf.font_region.Assign(info.font_region);
  272. bf.favorite_color.Assign(info.favorite_color);
  273. bf.gender.Assign(info.gender);
  274. bf.height.Assign(info.height);
  275. bf.build.Assign(info.weight);
  276. bf.type.Assign(info.type);
  277. bf.region_move.Assign(info.region);
  278. bf.faceline_type.Assign(info.face_type);
  279. bf.faceline_color.Assign(info.face_color);
  280. bf.faceline_wrinkle.Assign(info.face_wrinkle);
  281. bf.faceline_makeup.Assign(info.face_makeup);
  282. bf.hair_type.Assign(info.hair_type);
  283. bf.hair_color.Assign(HairColorLookup[info.hair_color]);
  284. bf.hair_flip.Assign(static_cast<HairFlip>(info.hair_flip));
  285. bf.eye_type.Assign(info.eye_type);
  286. bf.eye_color.Assign(EyeColorLookup[info.eye_color]);
  287. bf.eye_scale.Assign(info.eye_scale);
  288. bf.eye_aspect.Assign(info.eye_aspect);
  289. bf.eye_rotate.Assign(info.eye_rotate);
  290. bf.eye_x.Assign(info.eye_x);
  291. bf.eye_y.Assign(info.eye_y);
  292. bf.eyebrow_type.Assign(info.eyebrow_type);
  293. bf.eyebrow_color.Assign(HairColorLookup[info.eyebrow_color]);
  294. bf.eyebrow_scale.Assign(info.eyebrow_scale);
  295. bf.eyebrow_aspect.Assign(info.eyebrow_aspect);
  296. bf.eyebrow_rotate.Assign(info.eyebrow_rotate);
  297. bf.eyebrow_x.Assign(info.eyebrow_x);
  298. bf.eyebrow_y.Assign(info.eyebrow_y - 3);
  299. bf.nose_type.Assign(info.nose_type);
  300. bf.nose_scale.Assign(info.nose_scale);
  301. bf.nose_y.Assign(info.nose_y);
  302. bf.mouth_type.Assign(info.mouth_type);
  303. bf.mouth_color.Assign(MouthColorLookup[info.mouth_color]);
  304. bf.mouth_scale.Assign(info.mouth_scale);
  305. bf.mouth_aspect.Assign(info.mouth_aspect);
  306. bf.mouth_y.Assign(info.mouth_y);
  307. bf.beard_color.Assign(HairColorLookup[info.beard_color]);
  308. bf.beard_type.Assign(static_cast<BeardType>(info.beard_type));
  309. bf.mustache_type.Assign(static_cast<MustacheType>(info.mustache_type));
  310. bf.mustache_scale.Assign(info.mustache_scale);
  311. bf.mustache_y.Assign(info.mustache_y);
  312. bf.glasses_type.Assign(info.glasses_type);
  313. bf.glasses_color.Assign(GlassesColorLookup[info.glasses_color]);
  314. bf.glasses_scale.Assign(info.glasses_scale);
  315. bf.glasses_y.Assign(info.glasses_y);
  316. bf.mole_type.Assign(info.mole_type);
  317. bf.mole_scale.Assign(info.mole_scale);
  318. bf.mole_x.Assign(info.mole_x);
  319. bf.mole_y.Assign(info.mole_y);
  320. return {DefaultMiiName, bf, user_id};
  321. }
  322. } // namespace
  323. MiiStoreData::MiiStoreData() = default;
  324. MiiStoreData::MiiStoreData(const MiiStoreData::Name& name, const MiiStoreBitFields& bit_fields,
  325. const Common::NewUUID& user_id) {
  326. data.name = name;
  327. data.uuid = Common::NewUUID::MakeRandomRFC4122V4();
  328. std::memcpy(data.data.data(), &bit_fields, sizeof(MiiStoreBitFields));
  329. data_crc = GenerateCrc16(data.data.data(), sizeof(data));
  330. device_crc = GenerateCrc16(&user_id, sizeof(Common::NewUUID));
  331. }
  332. MiiManager::MiiManager() : user_id{Service::Account::ProfileManager().GetLastOpenedUser()} {}
  333. bool MiiManager::CheckAndResetUpdateCounter(SourceFlag source_flag, u64& current_update_counter) {
  334. if ((source_flag & SourceFlag::Database) == SourceFlag::None) {
  335. return false;
  336. }
  337. const bool result{current_update_counter != update_counter};
  338. current_update_counter = update_counter;
  339. return result;
  340. }
  341. bool MiiManager::IsFullDatabase() const {
  342. // TODO(bunnei): We don't implement the Mii database, so it cannot be full
  343. return false;
  344. }
  345. u32 MiiManager::GetCount(SourceFlag source_flag) const {
  346. std::size_t count{};
  347. if ((source_flag & SourceFlag::Database) != SourceFlag::None) {
  348. // TODO(bunnei): We don't implement the Mii database, but when we do, update this
  349. count += 0;
  350. }
  351. if ((source_flag & SourceFlag::Default) != SourceFlag::None) {
  352. count += (DefaultMiiCount - BaseMiiCount);
  353. }
  354. return static_cast<u32>(count);
  355. }
  356. ResultVal<MiiInfo> MiiManager::UpdateLatest([[maybe_unused]] const MiiInfo& info,
  357. SourceFlag source_flag) {
  358. if ((source_flag & SourceFlag::Database) == SourceFlag::None) {
  359. return ERROR_CANNOT_FIND_ENTRY;
  360. }
  361. // TODO(bunnei): We don't implement the Mii database, so we can't have an entry
  362. return ERROR_CANNOT_FIND_ENTRY;
  363. }
  364. MiiInfo MiiManager::BuildRandom(Age age, Gender gender, Race race) {
  365. return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id));
  366. }
  367. MiiInfo MiiManager::BuildDefault(std::size_t index) {
  368. return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id));
  369. }
  370. ResultVal<std::vector<MiiInfoElement>> MiiManager::GetDefault(SourceFlag source_flag) {
  371. std::vector<MiiInfoElement> result;
  372. if ((source_flag & SourceFlag::Default) == SourceFlag::None) {
  373. return result;
  374. }
  375. for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) {
  376. result.emplace_back(BuildDefault(index), Source::Default);
  377. }
  378. return result;
  379. }
  380. ResultCode MiiManager::GetIndex([[maybe_unused]] const MiiInfo& info, u32& index) {
  381. constexpr u32 INVALID_INDEX{0xFFFFFFFF};
  382. index = INVALID_INDEX;
  383. // TODO(bunnei): We don't implement the Mii database, so we can't have an index
  384. return ERROR_CANNOT_FIND_ENTRY;
  385. }
  386. } // namespace Service::Mii