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

53 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>
#include "core/hle/kernel/readable_event.h"
#include "core/hle/kernel/writable_event.h"
2018-03-29 21:06:51 -04:00
#include "core/hle/service/service.h"
namespace Service::NFP {
2018-03-29 21:06:51 -04:00
class Module final {
public:
class Interface : public ServiceFramework<Interface> {
public:
2019-09-21 19:03:20 +10:00
explicit Interface(std::shared_ptr<Module> module, Core::System& system, 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 std::shared_ptr<Kernel::ReadableEvent>& GetNFCEvent() const;
2018-10-24 10:28:17 +11:00
const AmiiboFile& GetAmiiboBuffer() const;
private:
Kernel::EventPair 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;
2019-09-21 19:03:20 +10:00
Core::System& system;
2018-03-29 21:06:51 -04:00
};
};
2019-09-21 19:03:20 +10:00
void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
2018-03-29 21:06:51 -04:00
} // namespace Service::NFP