Serialize ArchiveManager and other code review actions
This commit is contained in:
parent
04aa351c40
commit
6760ea18b6
|
@ -1,3 +1,4 @@
|
||||||
|
#pragma optimize("", off)
|
||||||
// Copyright 2014 Citra Emulator Project
|
// Copyright 2014 Citra Emulator Project
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
@ -544,6 +545,7 @@ void System::serialize(Archive& ar, const unsigned int file_version) {
|
||||||
ar&* cpu_cores[i].get();
|
ar&* cpu_cores[i].get();
|
||||||
}
|
}
|
||||||
ar&* service_manager.get();
|
ar&* service_manager.get();
|
||||||
|
ar&* archive_manager.get();
|
||||||
ar& GPU::g_regs;
|
ar& GPU::g_regs;
|
||||||
ar& LCD::g_regs;
|
ar& LCD::g_regs;
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ private:
|
||||||
LowPathType type;
|
LowPathType type;
|
||||||
std::vector<u8> binary;
|
std::vector<u8> binary;
|
||||||
std::string string;
|
std::string string;
|
||||||
std::u16string u16str{};
|
std::u16string u16str;
|
||||||
|
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar, const unsigned int) {
|
void serialize(Archive& ar, const unsigned int) {
|
||||||
|
@ -77,18 +77,16 @@ private:
|
||||||
case LowPathType::Char:
|
case LowPathType::Char:
|
||||||
ar& string;
|
ar& string;
|
||||||
break;
|
break;
|
||||||
#ifdef _WIN32
|
case LowPathType::Wchar: {
|
||||||
case LowPathType::Wchar:
|
std::vector<char16_t> data;
|
||||||
static_assert(sizeof(wchar_t) == sizeof(char16_t));
|
if (Archive::is_saving::value) {
|
||||||
{
|
std::copy(u16str.begin(), u16str.end(), std::back_inserter(data));
|
||||||
std::wstring wstring(reinterpret_cast<wchar_t*>(u16str.data()));
|
|
||||||
ar& wstring;
|
|
||||||
if (!Archive::is_saving::value) {
|
|
||||||
u16str = std::u16string(reinterpret_cast<char16_t*>(wstring.data()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
ar& data;
|
||||||
#endif
|
if (Archive::is_loading::value) {
|
||||||
|
u16str = std::u16string(data.data(), data.size());
|
||||||
|
}
|
||||||
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,14 @@ public:
|
||||||
}
|
}
|
||||||
return SaveDataArchive::CreateFile(path, size);
|
return SaveDataArchive::CreateFile(path, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ExtSaveDataArchive() = default;
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive& ar, const unsigned int) {
|
||||||
|
ar& boost::serialization::base_object<SaveDataArchive>(*this);
|
||||||
|
}
|
||||||
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ExtSaveDataArchivePath {
|
struct ExtSaveDataArchivePath {
|
||||||
|
@ -304,3 +312,4 @@ void ArchiveFactory_ExtSaveData::WriteIcon(const Path& path, const u8* icon_data
|
||||||
} // namespace FileSys
|
} // namespace FileSys
|
||||||
|
|
||||||
SERIALIZE_EXPORT_IMPL(FileSys::ExtSaveDataDelayGenerator)
|
SERIALIZE_EXPORT_IMPL(FileSys::ExtSaveDataDelayGenerator)
|
||||||
|
SERIALIZE_EXPORT_IMPL(FileSys::ExtSaveDataArchive)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include <boost/serialization/export.hpp>
|
#include <boost/serialization/export.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "core/file_sys/archive_source_sd_savedata.h"
|
#include "core/file_sys/archive_source_sd_savedata.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "core/file_sys/archive_source_sd_savedata.h"
|
#include "core/file_sys/archive_source_sd_savedata.h"
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/serialization/export.hpp>
|
#include <boost/serialization/export.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
|
#include <boost/serialization/unordered_map.hpp>
|
||||||
#include <boost/serialization/vector.hpp>
|
#include <boost/serialization/vector.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/file_sys/archive_backend.h"
|
#include "core/file_sys/archive_backend.h"
|
||||||
|
@ -63,7 +64,7 @@ private:
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar, const unsigned int) {
|
void serialize(Archive& ar, const unsigned int) {
|
||||||
ar& boost::serialization::base_object<ArchiveFactory>(*this);
|
ar& boost::serialization::base_object<ArchiveFactory>(*this);
|
||||||
// NOTE: ncch_data is never written to, so we don't serialize it here
|
ar& ncch_data;
|
||||||
}
|
}
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/serialization/base_object.hpp>
|
|
||||||
#include <boost/serialization/unique_ptr.hpp>
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
|
|
@ -23,14 +23,6 @@ struct RomFSHeader {
|
||||||
struct Descriptor {
|
struct Descriptor {
|
||||||
u32_le offset;
|
u32_le offset;
|
||||||
u32_le length;
|
u32_le length;
|
||||||
|
|
||||||
private:
|
|
||||||
template <class Archive>
|
|
||||||
void serialize(Archive& ar, const unsigned int) {
|
|
||||||
ar& offset;
|
|
||||||
ar& length;
|
|
||||||
}
|
|
||||||
friend class boost::serialization::access;
|
|
||||||
};
|
};
|
||||||
u32_le header_length;
|
u32_le header_length;
|
||||||
Descriptor directory_hash_table;
|
Descriptor directory_hash_table;
|
||||||
|
@ -146,6 +138,7 @@ private:
|
||||||
if (Archive::is_loading::value) {
|
if (Archive::is_loading::value) {
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
// NOTE: Everything else is essentially cached, updated when we call Load
|
||||||
}
|
}
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,10 +38,9 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string mount_point;
|
std::string mount_point;
|
||||||
|
|
||||||
private:
|
|
||||||
SaveDataArchive() = default;
|
SaveDataArchive() = default;
|
||||||
|
|
||||||
|
private:
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar, const unsigned int) {
|
void serialize(Archive& ar, const unsigned int) {
|
||||||
ar& boost::serialization::base_object<ArchiveBackend>(*this);
|
ar& boost::serialization::base_object<ArchiveBackend>(*this);
|
||||||
|
@ -51,8 +50,10 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
class SaveDataDelayGenerator;
|
class SaveDataDelayGenerator;
|
||||||
|
class ExtSaveDataArchive;
|
||||||
|
|
||||||
} // namespace FileSys
|
} // namespace FileSys
|
||||||
|
|
||||||
BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataArchive)
|
BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataArchive)
|
||||||
BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataDelayGenerator)
|
BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataDelayGenerator)
|
||||||
|
BOOST_CLASS_EXPORT_KEY(FileSys::ExtSaveDataArchive)
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
#include "core/hle/kernel/object.h"
|
#include "core/hle/kernel/object.h"
|
||||||
#include "core/hle/kernel/server_session.h"
|
#include "core/hle/kernel/server_session.h"
|
||||||
|
|
||||||
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Kernel::SessionRequestHandler)
|
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
class ServiceFrameworkBase;
|
class ServiceFrameworkBase;
|
||||||
}
|
}
|
||||||
|
@ -320,5 +318,4 @@ private:
|
||||||
|
|
||||||
} // namespace Kernel
|
} // namespace Kernel
|
||||||
|
|
||||||
BOOST_CLASS_EXPORT_KEY(Kernel::SessionRequestHandler::SessionDataBase)
|
|
||||||
BOOST_CLASS_EXPORT_KEY(Kernel::HLERequestContext::ThreadCallback)
|
BOOST_CLASS_EXPORT_KEY(Kernel::HLERequestContext::ThreadCallback)
|
||||||
|
|
|
@ -6,12 +6,12 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/serialization/array.hpp>
|
#include <boost/serialization/array.hpp>
|
||||||
#include <boost/serialization/bitset.hpp>
|
#include <boost/serialization/bitset.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "common/serialization/boost_vector.hpp"
|
#include "common/serialization/boost_vector.hpp"
|
||||||
#include "core/global.h"
|
|
||||||
#include "core/hle/kernel/errors.h"
|
#include "core/hle/kernel/errors.h"
|
||||||
#include "core/hle/kernel/memory.h"
|
#include "core/hle/kernel/memory.h"
|
||||||
#include "core/hle/kernel/process.h"
|
#include "core/hle/kernel/process.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <boost/container/static_vector.hpp>
|
#include <boost/container/static_vector.hpp>
|
||||||
#include <boost/serialization/base_object.hpp>
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include <boost/serialization/vector.hpp>
|
#include <boost/serialization/vector.hpp>
|
||||||
|
#include <boost/serialization/string.hpp>
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/kernel/handle_table.h"
|
#include "core/hle/kernel/handle_table.h"
|
||||||
|
|
|
@ -16,8 +16,6 @@ namespace Kernel {
|
||||||
class Event;
|
class Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Service::AC::Module::Interface)
|
|
||||||
|
|
||||||
namespace Service::AC {
|
namespace Service::AC {
|
||||||
class Module final {
|
class Module final {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
inline void serialize(Archive& ar, const unsigned int file_version) {}
|
void serialize(Archive& ar, const unsigned int file_version) {}
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include <boost/serialization/vector.hpp>
|
#include <boost/serialization/vector.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
#include "common/construct.h"
|
||||||
#include "core/file_sys/cia_container.h"
|
#include "core/file_sys/cia_container.h"
|
||||||
#include "core/file_sys/file_backend.h"
|
#include "core/file_sys/file_backend.h"
|
||||||
#include "core/global.h"
|
#include "core/global.h"
|
||||||
|
@ -154,7 +155,6 @@ std::string GetMediaTitlePath(Service::FS::MediaType media_type);
|
||||||
class Module final {
|
class Module final {
|
||||||
public:
|
public:
|
||||||
explicit Module(Core::System& system);
|
explicit Module(Core::System& system);
|
||||||
explicit Module(Kernel::KernelSystem& kernel);
|
|
||||||
Module() = default;
|
Module() = default;
|
||||||
~Module();
|
~Module();
|
||||||
|
|
||||||
|
@ -568,6 +568,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
explicit Module(Kernel::KernelSystem& kernel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scans the for titles in a storage medium for listing.
|
* Scans the for titles in a storage medium for listing.
|
||||||
* @param media_type the storage medium to scan
|
* @param media_type the storage medium to scan
|
||||||
|
@ -590,6 +592,16 @@ private:
|
||||||
ar& am_title_list;
|
ar& am_title_list;
|
||||||
ar& system_updater_mutex;
|
ar& system_updater_mutex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
static void load_construct(Archive& ar, Module* t, const unsigned int file_version) {
|
||||||
|
::new (t) Module(Core::Global<Kernel::KernelSystem>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void save_construct(Archive& ar, const unsigned int file_version) const {}
|
||||||
|
|
||||||
|
friend class ::construct_access;
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -597,9 +609,4 @@ void InstallInterfaces(Core::System& system);
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|
||||||
namespace boost::serialization {
|
BOOST_SERIALIZATION_CONSTRUCT(Service::AM::Module);
|
||||||
template <class Archive>
|
|
||||||
inline void load_construct_data(Archive& ar, Service::AM::Module* t, const unsigned int) {
|
|
||||||
::new (t) Service::AM::Module(Core::Global<Kernel::KernelSystem>());
|
|
||||||
}
|
|
||||||
} // namespace boost::serialization
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <boost/serialization/array.hpp>
|
#include <boost/serialization/array.hpp>
|
||||||
#include <boost/serialization/optional.hpp>
|
#include <boost/serialization/optional.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
|
#include <boost/serialization/vector.hpp>
|
||||||
#include "core/global.h"
|
#include "core/global.h"
|
||||||
#include "core/hle/kernel/event.h"
|
#include "core/hle/kernel/event.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
|
#include <boost/serialization/vector.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/common_paths.h"
|
#include "common/common_paths.h"
|
||||||
#include "common/file_util.h"
|
#include "common/file_util.h"
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
|
||||||
#include <boost/serialization/vector.hpp>
|
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/common_funcs.h"
|
#include "common/common_funcs.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
@ -651,7 +649,4 @@ void InstallInterfaces(Core::System& system);
|
||||||
|
|
||||||
} // namespace Service::APT
|
} // namespace Service::APT
|
||||||
|
|
||||||
namespace boost::serialization {
|
SERVICE_CONSTRUCT(Service::APT::Module)
|
||||||
template <class Archive>
|
|
||||||
void load_construct_data(Archive& ar, Service::APT::Module* t, const unsigned int);
|
|
||||||
}
|
|
||||||
|
|
|
@ -989,7 +989,7 @@ void InstallInterfaces(Core::System& system);
|
||||||
|
|
||||||
namespace boost::serialization {
|
namespace boost::serialization {
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
inline void load_construct_data(Archive& ar, Service::BOSS::Module* t, const unsigned int) {
|
void load_construct_data(Archive& ar, Service::BOSS::Module* t, const unsigned int) {
|
||||||
::new (t) Service::BOSS::Module(Core::Global<Core::System>());
|
::new (t) Service::BOSS::Module(Core::Global<Core::System>());
|
||||||
}
|
}
|
||||||
} // namespace boost::serialization
|
} // namespace boost::serialization
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
#include <future>
|
#include <future>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <boost/serialization/array.hpp>
|
||||||
|
#include <boost/serialization/deque.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "common/swap.h"
|
#include "common/swap.h"
|
||||||
#include "core/global.h"
|
#include "core/global.h"
|
||||||
|
@ -849,6 +853,7 @@ private:
|
||||||
ar& completion_event;
|
ar& completion_event;
|
||||||
ar& buffer_error_interrupt_event;
|
ar& buffer_error_interrupt_event;
|
||||||
ar& vsync_interrupt_event;
|
ar& vsync_interrupt_event;
|
||||||
|
ar& vsync_timings;
|
||||||
// Ignore capture_result. In-progress captures might be affected but this is OK.
|
// Ignore capture_result. In-progress captures might be affected but this is OK.
|
||||||
ar& dest_process;
|
ar& dest_process;
|
||||||
ar& dest;
|
ar& dest;
|
||||||
|
@ -879,7 +884,7 @@ void InstallInterfaces(Core::System& system);
|
||||||
|
|
||||||
namespace boost::serialization {
|
namespace boost::serialization {
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
inline void load_construct_data(Archive& ar, Service::CAM::Module* t, const unsigned int) {
|
void load_construct_data(Archive& ar, Service::CAM::Module* t, const unsigned int) {
|
||||||
::new (t) Service::CAM::Module(Core::Global<Core::System>());
|
::new (t) Service::CAM::Module(Core::Global<Core::System>());
|
||||||
}
|
}
|
||||||
} // namespace boost::serialization
|
} // namespace boost::serialization
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include <cryptopp/base64.h>
|
#include <cryptopp/base64.h>
|
||||||
#include <cryptopp/hmac.h>
|
#include <cryptopp/hmac.h>
|
||||||
#include <cryptopp/sha.h>
|
#include <cryptopp/sha.h>
|
||||||
|
|
|
@ -258,7 +258,7 @@ public:
|
||||||
ar& data_path_type;
|
ar& data_path_type;
|
||||||
ar& open_mode.raw;
|
ar& open_mode.raw;
|
||||||
ar& path;
|
ar& path;
|
||||||
// ar& file;
|
ar& file;
|
||||||
}
|
}
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <boost/serialization/array.hpp>
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include <cryptopp/osrng.h>
|
#include <cryptopp/osrng.h>
|
||||||
#include <cryptopp/sha.h>
|
#include <cryptopp/sha.h>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
|
|
|
@ -277,8 +277,4 @@ void InstallInterfaces(Core::System& system);
|
||||||
} // namespace Service::CSND
|
} // namespace Service::CSND
|
||||||
|
|
||||||
BOOST_CLASS_EXPORT_KEY(Service::CSND::CSND_SND)
|
BOOST_CLASS_EXPORT_KEY(Service::CSND::CSND_SND)
|
||||||
|
SERVICE_CONSTRUCT(Service::CSND::CSND_SND)
|
||||||
namespace boost::serialization {
|
|
||||||
template <class Archive>
|
|
||||||
void load_construct_data(Archive& ar, Service::CSND::CSND_SND* t, const unsigned int);
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <boost/serialization/array.hpp>
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "audio_core/dsp_interface.h"
|
#include "audio_core/dsp_interface.h"
|
||||||
#include "core/hle/kernel/event.h"
|
#include "core/hle/kernel/event.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
@ -282,8 +285,4 @@ void InstallInterfaces(Core::System& system);
|
||||||
} // namespace Service::DSP
|
} // namespace Service::DSP
|
||||||
|
|
||||||
BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP)
|
BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP)
|
||||||
|
SERVICE_CONSTRUCT(Service::DSP::DSP_DSP)
|
||||||
namespace boost::serialization {
|
|
||||||
template <class Archive>
|
|
||||||
void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int);
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/container/flat_map.hpp>
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
|
#include <boost/serialization/unordered_map.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/file_sys/archive_backend.h"
|
#include "core/file_sys/archive_backend.h"
|
||||||
#include "core/hle/result.h"
|
#include "core/hle/result.h"
|
||||||
|
@ -253,7 +254,7 @@ private:
|
||||||
* Map of registered archives, identified by id code. Once an archive is registered here, it is
|
* Map of registered archives, identified by id code. Once an archive is registered here, it is
|
||||||
* never removed until UnregisterArchiveTypes is called.
|
* never removed until UnregisterArchiveTypes is called.
|
||||||
*/
|
*/
|
||||||
boost::container::flat_map<ArchiveIdCode, std::unique_ptr<ArchiveFactory>> id_code_map;
|
std::unordered_map<ArchiveIdCode, std::unique_ptr<ArchiveFactory>> id_code_map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of active archive handles to archive objects
|
* Map of active archive handles to archive objects
|
||||||
|
@ -267,6 +268,7 @@ private:
|
||||||
ar& handle_map;
|
ar& handle_map;
|
||||||
ar& next_handle;
|
ar& next_handle;
|
||||||
}
|
}
|
||||||
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service::FS
|
} // namespace Service::FS
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/file_sys/directory_backend.h"
|
#include "core/file_sys/directory_backend.h"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include "core/file_sys/archive_backend.h"
|
#include "core/file_sys/archive_backend.h"
|
||||||
#include "core/global.h"
|
#include "core/global.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/kernel/event.h"
|
#include "core/hle/kernel/event.h"
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <boost/serialization/array.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "core/3ds.h"
|
#include "core/3ds.h"
|
||||||
|
@ -208,7 +211,7 @@ void Module::UpdateAccelerometerCallback(u64 userdata, s64 cycles_late) {
|
||||||
|
|
||||||
Common::Vec3<float> accel;
|
Common::Vec3<float> accel;
|
||||||
if (!motion_device) {
|
if (!motion_device) {
|
||||||
is_device_reload_pending.exchange(true);
|
is_device_reload_pending.store(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::tie(accel, std::ignore) = motion_device->GetStatus();
|
std::tie(accel, std::ignore) = motion_device->GetStatus();
|
||||||
|
@ -259,7 +262,7 @@ void Module::UpdateGyroscopeCallback(u64 userdata, s64 cycles_late) {
|
||||||
|
|
||||||
Common::Vec3<float> gyro;
|
Common::Vec3<float> gyro;
|
||||||
if (!motion_device) {
|
if (!motion_device) {
|
||||||
is_device_reload_pending.exchange(true);
|
is_device_reload_pending.store(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::tie(std::ignore, gyro) = motion_device->GetStatus();
|
std::tie(std::ignore, gyro) = motion_device->GetStatus();
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <boost/serialization/array.hpp>
|
#include <boost/serialization/array.hpp>
|
||||||
#include <boost/serialization/export.hpp>
|
|
||||||
#include "common/bit_field.h"
|
#include "common/bit_field.h"
|
||||||
#include "common/swap.h"
|
#include "common/swap.h"
|
||||||
#include "core/frontend/input.h"
|
#include "core/frontend/input.h"
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "common/archives.h"
|
#include "common/archives.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/core_timing.h"
|
#include "core/core_timing.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <boost/crc.hpp>
|
#include <boost/crc.hpp>
|
||||||
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include <boost/serialization/unique_ptr.hpp>
|
#include <boost/serialization/unique_ptr.hpp>
|
||||||
#include "common/string_util.h"
|
#include "common/string_util.h"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <boost/serialization/array.hpp>
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -22,6 +22,8 @@ void Module::serialize(Archive& ar, const unsigned int) {
|
||||||
ar& tag_out_of_range_event;
|
ar& tag_out_of_range_event;
|
||||||
ar& nfc_tag_state;
|
ar& nfc_tag_state;
|
||||||
ar& nfc_status;
|
ar& nfc_status;
|
||||||
|
ar& amiibo_data;
|
||||||
|
ar& amiibo_in_range;
|
||||||
}
|
}
|
||||||
SERIALIZE_IMPL(Module)
|
SERIALIZE_IMPL(Module)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <boost/serialization/binary_object.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
@ -35,6 +36,13 @@ struct AmiiboData {
|
||||||
u16_be model_number;
|
u16_be model_number;
|
||||||
u8 series;
|
u8 series;
|
||||||
INSERT_PADDING_BYTES(0x1C1);
|
INSERT_PADDING_BYTES(0x1C1);
|
||||||
|
|
||||||
|
private:
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive& ar, const unsigned int) {
|
||||||
|
ar& boost::serialization::make_binary_object(this, sizeof(AmiiboData));
|
||||||
|
}
|
||||||
|
friend class boost::serialization::access;
|
||||||
};
|
};
|
||||||
static_assert(sizeof(AmiiboData) == 0x21C, "AmiiboData is an invalid size");
|
static_assert(sizeof(AmiiboData) == 0x21C, "AmiiboData is an invalid size");
|
||||||
|
|
||||||
|
|
|
@ -1175,7 +1175,7 @@ void NWM_UDS::GetChannel(Kernel::HLERequestContext& ctx) {
|
||||||
|
|
||||||
class NWM_UDS::ThreadCallback : public Kernel::HLERequestContext::WakeupCallback {
|
class NWM_UDS::ThreadCallback : public Kernel::HLERequestContext::WakeupCallback {
|
||||||
public:
|
public:
|
||||||
ThreadCallback(u16 command_id_) : command_id(command_id_) {}
|
explicit ThreadCallback(u16 command_id_) : command_id(command_id_) {}
|
||||||
|
|
||||||
void WakeUp(std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx,
|
void WakeUp(std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx,
|
||||||
Kernel::ThreadWakeupReason reason) {
|
Kernel::ThreadWakeupReason reason) {
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/container/flat_map.hpp>
|
#include <boost/container/flat_map.hpp>
|
||||||
#include <boost/serialization/assume_abstract.hpp>
|
|
||||||
#include <boost/serialization/base_object.hpp>
|
#include <boost/serialization/base_object.hpp>
|
||||||
#include <boost/serialization/shared_ptr.hpp>
|
#include <boost/serialization/shared_ptr.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
|
|
|
@ -88,7 +88,8 @@ void SRV::EnableNotification(Kernel::HLERequestContext& ctx) {
|
||||||
class SRV::ThreadCallback : public Kernel::HLERequestContext::WakeupCallback {
|
class SRV::ThreadCallback : public Kernel::HLERequestContext::WakeupCallback {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ThreadCallback(Core::System& system_, std::string name_) : system(system_), name(name_) {}
|
explicit ThreadCallback(Core::System& system_, std::string name_)
|
||||||
|
: system(system_), name(name_) {}
|
||||||
|
|
||||||
void WakeUp(std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx,
|
void WakeUp(std::shared_ptr<Kernel::Thread> thread, Kernel::HLERequestContext& ctx,
|
||||||
Kernel::ThreadWakeupReason reason) {
|
Kernel::ThreadWakeupReason reason) {
|
||||||
|
|
|
@ -13,4 +13,4 @@ add_library(network STATIC
|
||||||
|
|
||||||
create_target_directory_groups(network)
|
create_target_directory_groups(network)
|
||||||
|
|
||||||
target_link_libraries(network PRIVATE common enet Boost::boost)
|
target_link_libraries(network PRIVATE common enet Boost::serialization)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/serialization/access.hpp>
|
#include <boost/serialization/vector.hpp>
|
||||||
#include "common/common_types.h"
|
#include "common/common_types.h"
|
||||||
#include "network/room.h"
|
#include "network/room.h"
|
||||||
|
|
||||||
|
|
Reference in New Issue