mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-01 21:07:52 +00:00
input_common: Add amiibo with originality signature support
This commit is contained in:
parent
fb97aec26b
commit
0c90a0926f
2 changed files with 3 additions and 0 deletions
|
@ -82,6 +82,7 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(const std::string& filename) {
|
||||||
switch (nfc_file.GetSize()) {
|
switch (nfc_file.GetSize()) {
|
||||||
case AmiiboSize:
|
case AmiiboSize:
|
||||||
case AmiiboSizeWithoutPassword:
|
case AmiiboSizeWithoutPassword:
|
||||||
|
case AmiiboSizeWithSignature:
|
||||||
data.resize(AmiiboSize);
|
data.resize(AmiiboSize);
|
||||||
if (nfc_file.Read(data) < AmiiboSizeWithoutPassword) {
|
if (nfc_file.Read(data) < AmiiboSizeWithoutPassword) {
|
||||||
return Info::NotAnAmiibo;
|
return Info::NotAnAmiibo;
|
||||||
|
@ -109,6 +110,7 @@ VirtualAmiibo::Info VirtualAmiibo::LoadAmiibo(std::span<u8> data) {
|
||||||
switch (data.size_bytes()) {
|
switch (data.size_bytes()) {
|
||||||
case AmiiboSize:
|
case AmiiboSize:
|
||||||
case AmiiboSizeWithoutPassword:
|
case AmiiboSizeWithoutPassword:
|
||||||
|
case AmiiboSizeWithSignature:
|
||||||
nfc_data.resize(AmiiboSize);
|
nfc_data.resize(AmiiboSize);
|
||||||
break;
|
break;
|
||||||
case MifareSize:
|
case MifareSize:
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
private:
|
private:
|
||||||
static constexpr std::size_t AmiiboSize = 0x21C;
|
static constexpr std::size_t AmiiboSize = 0x21C;
|
||||||
static constexpr std::size_t AmiiboSizeWithoutPassword = AmiiboSize - 0x8;
|
static constexpr std::size_t AmiiboSizeWithoutPassword = AmiiboSize - 0x8;
|
||||||
|
static constexpr std::size_t AmiiboSizeWithSignature = AmiiboSize + 0x20;
|
||||||
static constexpr std::size_t MifareSize = 0x400;
|
static constexpr std::size_t MifareSize = 0x400;
|
||||||
|
|
||||||
std::string file_path{};
|
std::string file_path{};
|
||||||
|
|
Loading…
Reference in a new issue