Serialize IR, MVD, NDM, NEWS, NFC

This commit is contained in:
Hamish Milne 2019-12-31 20:39:38 +00:00 committed by zhupengfei
parent 3d6e372f96
commit 2409ee39cb
19 changed files with 112 additions and 5 deletions

View file

@ -2,6 +2,7 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/core.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/event.h"
@ -10,8 +11,20 @@
#include "core/hle/service/nfc/nfc_m.h"
#include "core/hle/service/nfc/nfc_u.h"
SERVICE_CONSTRUCT_IMPL(Service::NFC::Module)
SERIALIZE_EXPORT_IMPL(Service::NFC::Module)
namespace Service::NFC {
template <class Archive>
void Module::serialize(Archive& ar, const unsigned int) {
ar& tag_in_range_event;
ar& tag_out_of_range_event;
ar& nfc_tag_state;
ar& nfc_status;
}
SERIALIZE_IMPL(Module)
struct TagInfo {
u16_le id_offset_size;
u8 unk1;

View file

@ -226,7 +226,7 @@ public:
*/
void GetIdentificationBlock(Kernel::HLERequestContext& ctx);
private:
protected:
std::shared_ptr<Module> nfc;
};
@ -241,8 +241,15 @@ private:
AmiiboData amiibo_data{};
bool amiibo_in_range = false;
template <class Archive>
void serialize(Archive& ar, const unsigned int);
friend class boost::serialization::access;
};
void InstallInterfaces(Core::System& system);
} // namespace Service::NFC
SERVICE_CONSTRUCT(Service::NFC::Module)
BOOST_CLASS_EXPORT_KEY(Service::NFC::Module)

View file

@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/nfc/nfc_m.h"
SERIALIZE_EXPORT_IMPL(Service::NFC::NFC_M)
namespace Service::NFC {
NFC_M::NFC_M(std::shared_ptr<Module> nfc) : Module::Interface(std::move(nfc), "nfc:m", 1) {

View file

@ -11,6 +11,12 @@ namespace Service::NFC {
class NFC_M final : public Module::Interface {
public:
explicit NFC_M(std::shared_ptr<Module> nfc);
private:
SERVICE_SERIALIZATION(NFC_M, nfc, Module)
};
} // namespace Service::NFC
BOOST_CLASS_EXPORT_KEY(Service::NFC::NFC_M)
BOOST_SERIALIZATION_CONSTRUCT(Service::NFC::NFC_M)

View file

@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/nfc/nfc_u.h"
SERIALIZE_EXPORT_IMPL(Service::NFC::NFC_U)
namespace Service::NFC {
NFC_U::NFC_U(std::shared_ptr<Module> nfc) : Module::Interface(std::move(nfc), "nfc:u", 1) {

View file

@ -11,6 +11,12 @@ namespace Service::NFC {
class NFC_U final : public Module::Interface {
public:
explicit NFC_U(std::shared_ptr<Module> nfc);
private:
SERVICE_SERIALIZATION(NFC_U, nfc, Module)
};
} // namespace Service::NFC
BOOST_CLASS_EXPORT_KEY(Service::NFC::NFC_U)
BOOST_SERIALIZATION_CONSTRUCT(Service::NFC::NFC_U)