From 27929d7ca2b5fffc8866941d08cda921d586c45d Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 10 Sep 2023 21:58:18 -0600 Subject: service: mii: separate mii types into their own file --- src/core/hle/service/mii/types/store_data.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/core/hle/service/mii/types/store_data.h (limited to 'src/core/hle/service/mii/types/store_data.h') diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h new file mode 100644 index 000000000..54a263b05 --- /dev/null +++ b/src/core/hle/service/mii/types/store_data.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "core/hle/service/mii/mii_types.h" +#include "core/hle/service/mii/types/core_data.h" + +namespace Service::Mii { + +struct StoreData { + StoreData(); + StoreData(const Nickname& name, const StoreDataBitFields& bit_fields, + const Common::UUID& user_id); + + CoreData core_data{}; + Common::UUID create_id{}; + u16 data_crc{}; + u16 device_crc{}; +}; +static_assert(sizeof(StoreData) == 0x44, "StoreData has incorrect size."); + +struct StoreDataElement { + StoreData store_data{}; + Source source{}; +}; +static_assert(sizeof(StoreDataElement) == 0x48, "StoreDataElement has incorrect size."); + +}; // namespace Service::Mii -- cgit v1.2.3 From 81f50d51326fc1ce401bd21c28cf78371b4ddcea Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 10 Sep 2023 22:52:33 -0600 Subject: service: mii: Move core data operations --- src/core/hle/service/mii/types/store_data.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/mii/types/store_data.h') diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index 54a263b05..be6950967 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -8,7 +8,8 @@ namespace Service::Mii { -struct StoreData { +class StoreData { +public: StoreData(); StoreData(const Nickname& name, const StoreDataBitFields& bit_fields, const Common::UUID& user_id); -- cgit v1.2.3 From d6037efe5e63d193ae8c586ff9d1e1326cae05cb Mon Sep 17 00:00:00 2001 From: german77 Date: Sun, 10 Sep 2023 23:07:00 -0600 Subject: service: mii: Move store data operations --- src/core/hle/service/mii/types/store_data.h | 71 +++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service/mii/types/store_data.h') diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index be6950967..cc8551a66 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -10,10 +10,75 @@ namespace Service::Mii { class StoreData { public: - StoreData(); - StoreData(const Nickname& name, const StoreDataBitFields& bit_fields, - const Common::UUID& user_id); + // nn::mii::detail::StoreDataRaw::BuildDefault + void BuildDefault(u32 mii_index); + // nn::mii::detail::StoreDataRaw::BuildDefault + void BuildBase(Gender gender); + // nn::mii::detail::StoreDataRaw::BuildRandom + void BuildRandom(Age age, Gender gender, Race race); + + void SetInvalidName(); + + bool IsSpecial() const; + + u32 IsValid() const; + + Common::UUID GetCreateId() const; + FontRegion GetFontRegion() const; + u8 GetFavoriteColor() const; + u8 GetGender() const; + u8 GetHeight() const; + u8 GetBuild() const; + u8 GetType() const; + u8 GetRegionMove() const; + u8 GetFacelineType() const; + u8 GetFacelineColor() const; + u8 GetFacelineWrinkle() const; + u8 GetFacelineMake() const; + u8 GetHairType() const; + u8 GetHairColor() const; + u8 GetHairFlip() const; + u8 GetEyeType() const; + u8 GetEyeColor() const; + u8 GetEyeScale() const; + u8 GetEyeAspect() const; + u8 GetEyeRotate() const; + u8 GetEyeX() const; + u8 GetEyeY() const; + u8 GetEyebrowType() const; + u8 GetEyebrowColor() const; + u8 GetEyebrowScale() const; + u8 GetEyebrowAspect() const; + u8 GetEyebrowRotate() const; + u8 GetEyebrowX() const; + u8 GetEyebrowY() const; + u8 GetNoseType() const; + u8 GetNoseScale() const; + u8 GetNoseY() const; + u8 GetMouthType() const; + u8 GetMouthColor() const; + u8 GetMouthScale() const; + u8 GetMouthAspect() const; + u8 GetMouthY() const; + u8 GetBeardColor() const; + u8 GetBeardType() const; + u8 GetMustacheType() const; + u8 GetMustacheScale() const; + u8 GetMustacheY() const; + u8 GetGlassType() const; + u8 GetGlassColor() const; + u8 GetGlassScale() const; + u8 GetGlassY() const; + u8 GetMoleType() const; + u8 GetMoleScale() const; + u8 GetMoleX() const; + u8 GetMoleY() const; + Nickname GetNickname() const; + + bool operator==(const StoreData& data); + +private: CoreData core_data{}; Common::UUID create_id{}; u16 data_crc{}; -- cgit v1.2.3 From 571399930cc3578acff064a7087fe85e7b2dd9b7 Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 11 Sep 2023 00:23:46 -0600 Subject: service: mii: Fix ver3 inconsistencies --- src/core/hle/service/mii/types/store_data.h | 54 +++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service/mii/types/store_data.h') diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index cc8551a66..1e010000b 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -18,12 +18,62 @@ public: // nn::mii::detail::StoreDataRaw::BuildRandom void BuildRandom(Age age, Gender gender, Race race); - void SetInvalidName(); - bool IsSpecial() const; u32 IsValid() const; + void SetFontRegion(FontRegion value); + void SetFavoriteColor(u8 value); + void SetGender(Gender value); + void SetHeight(u8 value); + void SetBuild(u8 value); + void SetType(u8 value); + void SetRegionMove(u8 value); + void SetFacelineType(u8 value); + void SetFacelineColor(u8 value); + void SetFacelineWrinkle(u8 value); + void SetFacelineMake(u8 value); + void SetHairType(u8 value); + void SetHairColor(u8 value); + void SetHairFlip(HairFlip value); + void SetEyeType(u8 value); + void SetEyeColor(u8 value); + void SetEyeScale(u8 value); + void SetEyeAspect(u8 value); + void SetEyeRotate(u8 value); + void SetEyeX(u8 value); + void SetEyeY(u8 value); + void SetEyebrowType(u8 value); + void SetEyebrowColor(u8 value); + void SetEyebrowScale(u8 value); + void SetEyebrowAspect(u8 value); + void SetEyebrowRotate(u8 value); + void SetEyebrowX(u8 value); + void SetEyebrowY(u8 value); + void SetNoseType(u8 value); + void SetNoseScale(u8 value); + void SetNoseY(u8 value); + void SetMouthType(u8 value); + void SetMouthColor(u8 value); + void SetMouthScale(u8 value); + void SetMouthAspect(u8 value); + void SetMouthY(u8 value); + void SetBeardColor(u8 value); + void SetBeardType(BeardType value); + void SetMustacheType(MustacheType value); + void SetMustacheScale(u8 value); + void SetMustacheY(u8 value); + void SetGlassType(u8 value); + void SetGlassColor(u8 value); + void SetGlassScale(u8 value); + void SetGlassY(u8 value); + void SetMoleType(u8 value); + void SetMoleScale(u8 value); + void SetMoleX(u8 value); + void SetMoleY(u8 value); + void SetNickname(Nickname nickname); + void SetInvalidName(); + Common::UUID GetCreateId() const; FontRegion GetFontRegion() const; u8 GetFavoriteColor() const; -- cgit v1.2.3 From 4d138b760b1eb09ee59dca40dba86112e3c8a39d Mon Sep 17 00:00:00 2001 From: Narr the Reg Date: Mon, 11 Sep 2023 17:12:51 -0600 Subject: service: mii: Remove most magic values --- src/core/hle/service/mii/types/store_data.h | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'src/core/hle/service/mii/types/store_data.h') diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index 1e010000b..224c32cf8 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -23,51 +23,51 @@ public: u32 IsValid() const; void SetFontRegion(FontRegion value); - void SetFavoriteColor(u8 value); + void SetFavoriteColor(FavoriteColor value); void SetGender(Gender value); void SetHeight(u8 value); void SetBuild(u8 value); void SetType(u8 value); void SetRegionMove(u8 value); - void SetFacelineType(u8 value); - void SetFacelineColor(u8 value); - void SetFacelineWrinkle(u8 value); - void SetFacelineMake(u8 value); - void SetHairType(u8 value); - void SetHairColor(u8 value); + void SetFacelineType(FacelineType value); + void SetFacelineColor(FacelineColor value); + void SetFacelineWrinkle(FacelineWrinkle value); + void SetFacelineMake(FacelineMake value); + void SetHairType(HairType value); + void SetHairColor(CommonColor value); void SetHairFlip(HairFlip value); - void SetEyeType(u8 value); - void SetEyeColor(u8 value); + void SetEyeType(EyeType value); + void SetEyeColor(CommonColor value); void SetEyeScale(u8 value); void SetEyeAspect(u8 value); void SetEyeRotate(u8 value); void SetEyeX(u8 value); void SetEyeY(u8 value); - void SetEyebrowType(u8 value); - void SetEyebrowColor(u8 value); + void SetEyebrowType(EyebrowType value); + void SetEyebrowColor(CommonColor value); void SetEyebrowScale(u8 value); void SetEyebrowAspect(u8 value); void SetEyebrowRotate(u8 value); void SetEyebrowX(u8 value); void SetEyebrowY(u8 value); - void SetNoseType(u8 value); + void SetNoseType(NoseType value); void SetNoseScale(u8 value); void SetNoseY(u8 value); void SetMouthType(u8 value); - void SetMouthColor(u8 value); + void SetMouthColor(CommonColor value); void SetMouthScale(u8 value); void SetMouthAspect(u8 value); void SetMouthY(u8 value); - void SetBeardColor(u8 value); + void SetBeardColor(CommonColor value); void SetBeardType(BeardType value); void SetMustacheType(MustacheType value); void SetMustacheScale(u8 value); void SetMustacheY(u8 value); - void SetGlassType(u8 value); - void SetGlassColor(u8 value); + void SetGlassType(GlassType value); + void SetGlassColor(CommonColor value); void SetGlassScale(u8 value); void SetGlassY(u8 value); - void SetMoleType(u8 value); + void SetMoleType(MoleType value); void SetMoleScale(u8 value); void SetMoleX(u8 value); void SetMoleY(u8 value); @@ -76,51 +76,51 @@ public: Common::UUID GetCreateId() const; FontRegion GetFontRegion() const; - u8 GetFavoriteColor() const; - u8 GetGender() const; + FavoriteColor GetFavoriteColor() const; + Gender GetGender() const; u8 GetHeight() const; u8 GetBuild() const; u8 GetType() const; u8 GetRegionMove() const; - u8 GetFacelineType() const; - u8 GetFacelineColor() const; - u8 GetFacelineWrinkle() const; - u8 GetFacelineMake() const; - u8 GetHairType() const; - u8 GetHairColor() const; - u8 GetHairFlip() const; - u8 GetEyeType() const; - u8 GetEyeColor() const; + FacelineType GetFacelineType() const; + FacelineColor GetFacelineColor() const; + FacelineWrinkle GetFacelineWrinkle() const; + FacelineMake GetFacelineMake() const; + HairType GetHairType() const; + CommonColor GetHairColor() const; + HairFlip GetHairFlip() const; + EyeType GetEyeType() const; + CommonColor GetEyeColor() const; u8 GetEyeScale() const; u8 GetEyeAspect() const; u8 GetEyeRotate() const; u8 GetEyeX() const; u8 GetEyeY() const; - u8 GetEyebrowType() const; - u8 GetEyebrowColor() const; + EyebrowType GetEyebrowType() const; + CommonColor GetEyebrowColor() const; u8 GetEyebrowScale() const; u8 GetEyebrowAspect() const; u8 GetEyebrowRotate() const; u8 GetEyebrowX() const; u8 GetEyebrowY() const; - u8 GetNoseType() const; + NoseType GetNoseType() const; u8 GetNoseScale() const; u8 GetNoseY() const; - u8 GetMouthType() const; - u8 GetMouthColor() const; + MouthType GetMouthType() const; + CommonColor GetMouthColor() const; u8 GetMouthScale() const; u8 GetMouthAspect() const; u8 GetMouthY() const; - u8 GetBeardColor() const; - u8 GetBeardType() const; - u8 GetMustacheType() const; + CommonColor GetBeardColor() const; + BeardType GetBeardType() const; + MustacheType GetMustacheType() const; u8 GetMustacheScale() const; u8 GetMustacheY() const; - u8 GetGlassType() const; - u8 GetGlassColor() const; + GlassType GetGlassType() const; + CommonColor GetGlassColor() const; u8 GetGlassScale() const; u8 GetGlassY() const; - u8 GetMoleType() const; + MoleType GetMoleType() const; u8 GetMoleScale() const; u8 GetMoleX() const; u8 GetMoleY() const; -- cgit v1.2.3