diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2022-08-31 02:28:37 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-09-07 08:04:00 +0200 |
commit | caa138b33f6bbc18cde4d403017dad6bd4387e13 (patch) | |
tree | 7de25f6a4f3f17e2beff0711e01119bedde15c2e /src/core/hle/service/nfp/amiibo_types.h | |
parent | core: nfp: Implement Convert and RecreateApplicationArea, accuracy fixes (diff) | |
download | yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar.gz yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar.bz2 yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar.lz yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar.xz yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.tar.zst yuzu-caa138b33f6bbc18cde4d403017dad6bd4387e13.zip |
Diffstat (limited to 'src/core/hle/service/nfp/amiibo_types.h')
-rw-r--r-- | src/core/hle/service/nfp/amiibo_types.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/hle/service/nfp/amiibo_types.h b/src/core/hle/service/nfp/amiibo_types.h index bd0424ffd..c9c0932d0 100644 --- a/src/core/hle/service/nfp/amiibo_types.h +++ b/src/core/hle/service/nfp/amiibo_types.h @@ -8,6 +8,8 @@ #include "core/hle/service/mii/types.h" namespace Service::NFP { +static constexpr std::size_t amiibo_name_length = 0xA; + enum class ServiceType : u32 { User, Debug, @@ -76,16 +78,16 @@ using HashData = std::array<u8, 0x20>; using ApplicationArea = std::array<u8, 0xD8>; struct AmiiboDate { - u16_be raw_date{}; + u16 raw_date{}; u16 GetYear() const { - return ((raw_date & 0xFE00) >> 9) + 2000; + return static_cast<u16>(((raw_date & 0xFE00) >> 9) + 2000); } u8 GetMonth() const { - return ((raw_date & 0x01E0) >> 5) - 1; + return static_cast<u8>(((raw_date & 0x01E0) >> 5) - 1); } u8 GetDay() const { - return raw_date & 0x001F; + return static_cast<u8>(raw_date & 0x001F); } }; static_assert(sizeof(AmiiboDate) == 2, "AmiiboDate is an invalid size"); @@ -107,7 +109,7 @@ struct AmiiboSettings { AmiiboDate init_date; AmiiboDate write_date; u32_be crc; - std::array<u16_be, 0xA> amiibo_name; // UTF-16 text + std::array<u16_be, amiibo_name_length> amiibo_name; // UTF-16 text }; static_assert(sizeof(AmiiboSettings) == 0x20, "AmiiboSettings is an invalid size"); |