summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nfp/nfp_types.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2022-11-10 20:52:48 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2022-12-02 03:43:59 +0100
commita4725bcb73c5038853f460e15c4bfa9f679e7f4b (patch)
treeee0ab201ee43638ba274c7fdced6d97c490e4cfb /src/core/hle/service/nfp/nfp_types.h
parentMerge pull request #9320 from yuzu-emu/fix-audio-suspend (diff)
downloadyuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar.gz
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar.bz2
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar.lz
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar.xz
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.tar.zst
yuzu-a4725bcb73c5038853f460e15c4bfa9f679e7f4b.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nfp/nfp_types.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/hle/service/nfp/nfp_types.h b/src/core/hle/service/nfp/nfp_types.h
index 69858096a..fc228c2b2 100644
--- a/src/core/hle/service/nfp/nfp_types.h
+++ b/src/core/hle/service/nfp/nfp_types.h
@@ -106,11 +106,24 @@ enum class CabinetMode : u8 {
StartFormatter,
};
+enum class MifareCmd : u8 {
+ AuthA = 0x60,
+ AuthB = 0x61,
+ Read = 0x30,
+ Write = 0xA0,
+ Transfer = 0xB0,
+ Decrement = 0xC0,
+ Increment = 0xC1,
+ Store = 0xC2
+};
+
using UniqueSerialNumber = std::array<u8, 7>;
using LockBytes = std::array<u8, 2>;
using HashData = std::array<u8, 0x20>;
using ApplicationArea = std::array<u8, 0xD8>;
using AmiiboName = std::array<char, (amiibo_name_length * 4) + 1>;
+using DataBlock = std::array<u8, 0x10>;
+using KeyData = std::array<u8, 0x6>;
struct TagUuid {
UniqueSerialNumber uid;
@@ -323,4 +336,37 @@ struct RegisterInfo {
};
static_assert(sizeof(RegisterInfo) == 0x100, "RegisterInfo is an invalid size");
+struct SectorKey {
+ MifareCmd command;
+ u8 unknown; // Usually 1
+ INSERT_PADDING_BYTES(0x6);
+ KeyData sector_key;
+ INSERT_PADDING_BYTES(0x2);
+};
+static_assert(sizeof(SectorKey) == 0x10, "SectorKey is an invalid size");
+
+struct MifareReadBlockParameter {
+ u8 sector_number;
+ INSERT_PADDING_BYTES(0x7);
+ SectorKey sector_key;
+};
+static_assert(sizeof(MifareReadBlockParameter) == 0x18,
+ "MifareReadBlockParameter is an invalid size");
+
+struct MifareReadBlockData {
+ DataBlock data;
+ u8 sector_number;
+ INSERT_PADDING_BYTES(0x7);
+};
+static_assert(sizeof(MifareReadBlockData) == 0x18, "MifareReadBlockData is an invalid size");
+
+struct MifareWriteBlockParameter {
+ DataBlock data;
+ u8 sector_number;
+ INSERT_PADDING_BYTES(0x7);
+ SectorKey sector_key;
+};
+static_assert(sizeof(MifareWriteBlockParameter) == 0x28,
+ "MifareWriteBlockParameter is an invalid size");
+
} // namespace Service::NFP