Files
eden/src/core/hle/service/nfp/nfp.h
T

55 lines
1.5 KiB
C++
Raw Normal View History

2018-03-29 21:06:51 -04:00
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
2018-10-24 10:28:17 +11:00
#include <array>
#include <vector>
2018-03-29 21:06:51 -04:00
#include "core/hle/service/service.h"
namespace Kernel {
class ReadableEvent;
class WritableEvent;
} // namespace Kernel
namespace Service::NFP {
2018-03-29 21:06:51 -04:00
class Module final {
public:
class Interface : public ServiceFramework<Interface> {
public:
explicit Interface(std::shared_ptr<Module> module, const char* name);
~Interface() override;
2018-03-29 21:06:51 -04:00
2018-10-24 10:28:17 +11:00
struct ModelInfo {
std::array<u8, 0x8> amiibo_identification_block;
INSERT_PADDING_BYTES(0x38);
};
static_assert(sizeof(ModelInfo) == 0x40, "ModelInfo is an invalid size");
struct AmiiboFile {
std::array<u8, 10> uuid;
INSERT_PADDING_BYTES(0x4a);
ModelInfo model_info;
};
static_assert(sizeof(AmiiboFile) == 0x94, "AmiiboFile is an invalid size");
void CreateUserInterface(Kernel::HLERequestContext& ctx);
bool LoadAmiibo(const std::vector<u8>& buffer);
const Kernel::SharedPtr<Kernel::ReadableEvent>& GetNFCEvent() const;
2018-10-24 10:28:17 +11:00
const AmiiboFile& GetAmiiboBuffer() const;
private:
Kernel::SharedPtr<Kernel::WritableEvent> nfc_tag_load{};
2018-10-24 10:28:17 +11:00
AmiiboFile amiibo{};
2018-03-29 21:06:51 -04:00
protected:
std::shared_ptr<Module> module;
};
};
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Service::NFP