diff --git a/TODO b/TODO index a422fda4d..def70ac2b 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,7 @@ ☐ Review constructor/initialization code ☐ Review core timing events ☐ Review base class serialization everywhere + Make sure that all base/derived relationships are registered ☐ Serialize codeset with an apploader reference instead ✔ CPU @done(19-08-13 15:41) ✔ Memory @done(19-08-13 15:41) diff --git a/src/common/archives.h b/src/common/archives.h index 6000bef2c..eef292634 100644 --- a/src/common/archives.h +++ b/src/common/archives.h @@ -10,5 +10,6 @@ using oarchive = boost::archive::binary_oarchive; template void A::serialize(oarchive & ar, const unsigned int file_version); #define SERIALIZE_EXPORT_IMPL(A) \ + BOOST_CLASS_EXPORT_IMPLEMENT(A) \ BOOST_SERIALIZATION_REGISTER_ARCHIVE(iarchive) \ BOOST_SERIALIZATION_REGISTER_ARCHIVE(oarchive) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index d59e34dae..ca86f7bfc 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -901,10 +901,18 @@ IOFile& IOFile::operator=(IOFile&& other) { void IOFile::Swap(IOFile& other) { std::swap(m_file, other.m_file); std::swap(m_good, other.m_good); + std::swap(filename, other.filename); + std::swap(openmode, other.openmode); + std::swap(flags, other.flags); } bool IOFile::Open(const std::string& filename, const char openmode[], int flags) { Close(); + + this->filename = filename; + this->openmode = openmode; + this->flags = flags; + #ifdef _WIN32 if (flags != 0) { m_file = _wfsopen(Common::UTF8ToUTF16W(filename).c_str(), diff --git a/src/common/file_util.h b/src/common/file_util.h index 09c3cb6f0..c09aa88d6 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include "common/common_types.h" #ifdef _MSC_VER #include "common/string_util.h" @@ -221,7 +223,6 @@ public: void Swap(IOFile& other); - bool Open(const std::string& filename, const char openmode[], int flags = 0); bool Close(); template @@ -305,8 +306,34 @@ public: } private: + bool Open(const std::string& filename, const char openmode[], int flags = 0); + std::FILE* m_file = nullptr; bool m_good = true; + + std::string filename; + std::string openmode; + u32 flags; + + template + void save(Archive& ar, const unsigned int) const { + ar << filename; + ar << openmode; + ar << flags; + ar << Tell(); + } + + template + void load(Archive& ar, const unsigned int) { + ar >> filename; + ar >> openmode; + ar >> flags; + u64 pos; + ar >> pos; + Seek(pos, SEEK_SET); + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() }; } // namespace FileUtil diff --git a/src/common/memory_ref.h b/src/common/memory_ref.h index 05b1c7901..ae30b009c 100644 --- a/src/common/memory_ref.h +++ b/src/common/memory_ref.h @@ -14,6 +14,11 @@ public: virtual ~BackingMem() = default; virtual u8* GetPtr() = 0; virtual u32 GetSize() const = 0; + +private: + template + void serialize(Archive& ar, const unsigned int) {} + friend class boost::serialization::access; }; /// Backing memory implemented by a local buffer @@ -39,6 +44,7 @@ private: template void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); ar& data; } friend class boost::serialization::access; diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 22084b690..59973b8c5 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -80,6 +80,8 @@ public: static constexpr u64 IPCDelayNanoseconds(3085068); return IPCDelayNanoseconds; } + + SERIALIZE_DELAY_GENERATOR }; /** @@ -300,3 +302,5 @@ void ArchiveFactory_ExtSaveData::WriteIcon(const Path& path, const u8* icon_data } } // namespace FileSys + +SERIALIZE_EXPORT_IMPL(FileSys::ExtSaveDataDelayGenerator) diff --git a/src/core/file_sys/archive_extsavedata.h b/src/core/file_sys/archive_extsavedata.h index b00e1633d..c9b84c984 100644 --- a/src/core/file_sys/archive_extsavedata.h +++ b/src/core/file_sys/archive_extsavedata.h @@ -103,6 +103,9 @@ std::string GetExtDataContainerPath(const std::string& mount_point, bool shared) */ Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low); +class ExtSaveDataDelayGenerator; + } // namespace FileSys BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_ExtSaveData) +BOOST_CLASS_EXPORT_KEY(FileSys::ExtSaveDataDelayGenerator) diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 1c5118320..4c3ce6d69 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -41,6 +41,8 @@ public: static constexpr u64 IPCDelayNanoseconds(269082); return IPCDelayNanoseconds; } + + SERIALIZE_DELAY_GENERATOR }; ResultVal> SDMCArchive::OpenFile(const Path& path, @@ -409,3 +411,5 @@ ResultVal ArchiveFactory_SDMC::GetFormatInfo(const Path& path return ResultCode(-1); } } // namespace FileSys + +SERIALIZE_EXPORT_IMPL(FileSys::SDMCDelayGenerator) diff --git a/src/core/file_sys/archive_sdmc.h b/src/core/file_sys/archive_sdmc.h index 2e0abf44b..6051abef0 100644 --- a/src/core/file_sys/archive_sdmc.h +++ b/src/core/file_sys/archive_sdmc.h @@ -86,7 +86,10 @@ private: friend class boost::serialization::access; }; +class SDMCDelayGenerator; + } // namespace FileSys BOOST_CLASS_EXPORT_KEY(FileSys::SDMCArchive) BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SDMC) +BOOST_CLASS_EXPORT_KEY(FileSys::SDMCDelayGenerator) diff --git a/src/core/file_sys/archive_sdmcwriteonly.cpp b/src/core/file_sys/archive_sdmcwriteonly.cpp index ea64dc864..241e93f0a 100644 --- a/src/core/file_sys/archive_sdmcwriteonly.cpp +++ b/src/core/file_sys/archive_sdmcwriteonly.cpp @@ -39,6 +39,8 @@ public: static constexpr u64 IPCDelayNanoseconds(269082); return IPCDelayNanoseconds; } + + SERIALIZE_DELAY_GENERATOR }; ResultVal> SDMCWriteOnlyArchive::OpenFile(const Path& path, @@ -100,3 +102,5 @@ ResultVal ArchiveFactory_SDMCWriteOnly::GetFormatInfo(const P } } // namespace FileSys + +SERIALIZE_EXPORT_IMPL(FileSys::SDMCWriteOnlyDelayGenerator) diff --git a/src/core/file_sys/archive_sdmcwriteonly.h b/src/core/file_sys/archive_sdmcwriteonly.h index 2ba504aa7..19982a9db 100644 --- a/src/core/file_sys/archive_sdmcwriteonly.h +++ b/src/core/file_sys/archive_sdmcwriteonly.h @@ -72,7 +72,10 @@ private: friend class boost::serialization::access; }; +class SDMCWriteOnlyDelayGenerator; + } // namespace FileSys BOOST_CLASS_EXPORT_KEY(FileSys::SDMCWriteOnlyArchive) BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SDMCWriteOnly) +BOOST_CLASS_EXPORT_KEY(FileSys::SDMCWriteOnlyDelayGenerator) diff --git a/src/core/file_sys/delay_generator.h b/src/core/file_sys/delay_generator.h index 8fa92ac41..6513a730e 100644 --- a/src/core/file_sys/delay_generator.h +++ b/src/core/file_sys/delay_generator.h @@ -5,10 +5,18 @@ #pragma once #include -#include +#include #include #include "common/common_types.h" +#define SERIALIZE_DELAY_GENERATOR \ +private: \ + template \ + void serialize(Archive& ar, const unsigned int) { \ + ar& boost::serialization::base_object(*this); \ + } \ + friend class boost::serialization::access; + namespace FileSys { class DelayGenerator { @@ -28,6 +36,8 @@ class DefaultDelayGenerator : public DelayGenerator { public: u64 GetReadDelayNs(std::size_t length) override; u64 GetOpenDelayNs() override; + + SERIALIZE_DELAY_GENERATOR }; } // namespace FileSys diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 481aa470a..9251749ce 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include "common/common_types.h" #include "common/file_util.h" #include "core/file_sys/archive_backend.h" @@ -43,6 +45,13 @@ public: protected: Mode mode; std::unique_ptr file; + + template + void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); + ar& mode; + ar& file; + } }; class DiskDirectory : public DirectoryBackend { diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index c865c98e8..04f03a77d 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include "common/common_types.h" #include "core/hle/result.h" #include "delay_generator.h" @@ -90,6 +92,12 @@ public: protected: std::unique_ptr delay_generator; + + template + void serialize(Archive& ar, const unsigned int) { + ar& delay_generator; + } + friend class boost::serialization::access; }; } // namespace FileSys diff --git a/src/core/file_sys/savedata_archive.cpp b/src/core/file_sys/savedata_archive.cpp index 8d7830468..1f22b50ab 100644 --- a/src/core/file_sys/savedata_archive.cpp +++ b/src/core/file_sys/savedata_archive.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/archives.h" #include "common/file_util.h" #include "core/file_sys/disk_archive.h" #include "core/file_sys/errors.h" @@ -33,6 +34,8 @@ public: static constexpr u64 IPCDelayNanoseconds(269082); return IPCDelayNanoseconds; } + + SERIALIZE_DELAY_GENERATOR }; ResultVal> SaveDataArchive::OpenFile(const Path& path, @@ -353,3 +356,5 @@ u64 SaveDataArchive::GetFreeBytes() const { } } // namespace FileSys + +SERIALIZE_EXPORT_IMPL(FileSys::SaveDataDelayGenerator) diff --git a/src/core/file_sys/savedata_archive.h b/src/core/file_sys/savedata_archive.h index 176d35710..47f2f75e0 100644 --- a/src/core/file_sys/savedata_archive.h +++ b/src/core/file_sys/savedata_archive.h @@ -40,4 +40,8 @@ protected: std::string mount_point; }; +class SaveDataDelayGenerator; + } // namespace FileSys + +BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataDelayGenerator) diff --git a/src/core/hle/service/cam/cam_q.h b/src/core/hle/service/cam/cam_q.h index ab901cf85..992b38390 100644 --- a/src/core/hle/service/cam/cam_q.h +++ b/src/core/hle/service/cam/cam_q.h @@ -13,11 +13,7 @@ public: CAM_Q(); private: - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::CAM diff --git a/src/core/hle/service/cfg/cfg_nor.h b/src/core/hle/service/cfg/cfg_nor.h index 1eca85a05..7e0a1a2b8 100644 --- a/src/core/hle/service/cfg/cfg_nor.h +++ b/src/core/hle/service/cfg/cfg_nor.h @@ -11,6 +11,9 @@ namespace Service::CFG { class CFG_NOR final : public ServiceFramework { public: CFG_NOR(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::CFG diff --git a/src/core/hle/service/dlp/dlp_clnt.h b/src/core/hle/service/dlp/dlp_clnt.h index 835d01748..ac6933e7e 100644 --- a/src/core/hle/service/dlp/dlp_clnt.h +++ b/src/core/hle/service/dlp/dlp_clnt.h @@ -14,11 +14,7 @@ public: ~DLP_CLNT() = default; private: - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::DLP diff --git a/src/core/hle/service/dlp/dlp_fkcl.h b/src/core/hle/service/dlp/dlp_fkcl.h index d778ace8b..c05a77b49 100644 --- a/src/core/hle/service/dlp/dlp_fkcl.h +++ b/src/core/hle/service/dlp/dlp_fkcl.h @@ -14,11 +14,7 @@ public: ~DLP_FKCL() = default; private: - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::DLP diff --git a/src/core/hle/service/dlp/dlp_srvr.h b/src/core/hle/service/dlp/dlp_srvr.h index 1f171f950..625740d2f 100644 --- a/src/core/hle/service/dlp/dlp_srvr.h +++ b/src/core/hle/service/dlp/dlp_srvr.h @@ -16,11 +16,7 @@ public: private: void IsChild(Kernel::HLERequestContext& ctx); - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::DLP diff --git a/src/core/hle/service/err_f.h b/src/core/hle/service/err_f.h index de92fed05..1b9fad452 100644 --- a/src/core/hle/service/err_f.h +++ b/src/core/hle/service/err_f.h @@ -35,11 +35,7 @@ private: Core::System& system; - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; void InstallInterfaces(Core::System& system); diff --git a/src/core/hle/service/fs/file.h b/src/core/hle/service/fs/file.h index ff4a5670a..18317212e 100644 --- a/src/core/hle/service/fs/file.h +++ b/src/core/hle/service/fs/file.h @@ -19,6 +19,17 @@ struct FileSessionSlot : public Kernel::SessionRequestHandler::SessionDataBase { u64 offset; ///< Offset that this session will start reading from. u64 size; ///< Max size of the file that this session is allowed to access bool subfile; ///< Whether this file was opened via OpenSubFile or not. + +private: + template + void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object( + *this); + ar& priority; + ar& offset; + ar& size; + ar& subfile; + } }; // TODO: File is not a real service, but it can still utilize ServiceFramework::RegisterHandlers. diff --git a/src/core/hle/service/fs/fs_user.h b/src/core/hle/service/fs/fs_user.h index 29b47a99c..83183ecf6 100644 --- a/src/core/hle/service/fs/fs_user.h +++ b/src/core/hle/service/fs/fs_user.h @@ -26,6 +26,8 @@ struct ClientSlot : public Kernel::SessionRequestHandler::SessionDataBase { private: template void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object( + *this); ar& program_id; } friend class boost::serialization::access; diff --git a/src/core/hle/service/gsp/gsp_gpu.h b/src/core/hle/service/gsp/gsp_gpu.h index 6194f0446..a97aee278 100644 --- a/src/core/hle/service/gsp/gsp_gpu.h +++ b/src/core/hle/service/gsp/gsp_gpu.h @@ -203,6 +203,8 @@ public: private: template void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object( + *this); ar& gsp; ar& interrupt_event; ar& thread_id; diff --git a/src/core/hle/service/http_c.h b/src/core/hle/service/http_c.h index a3aa62ae0..641b6b4d1 100644 --- a/src/core/hle/service/http_c.h +++ b/src/core/hle/service/http_c.h @@ -240,6 +240,8 @@ struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase { private: template void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object( + *this); ar& current_http_context; ar& session_id; ar& num_http_contexts; diff --git a/src/core/hle/service/ldr_ro/ldr_ro.h b/src/core/hle/service/ldr_ro/ldr_ro.h index 2b6f79f03..7581884f6 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.h +++ b/src/core/hle/service/ldr_ro/ldr_ro.h @@ -18,6 +18,8 @@ struct ClientSlot : public Kernel::SessionRequestHandler::SessionDataBase { private: template void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object( + *this); ar& loaded_crs; } friend class boost::serialization::access; diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index 34b16094a..478bf110f 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp @@ -25,6 +25,7 @@ namespace Service::MIC { template void MIC_U::serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); ar&* impl.get(); } SERIALIZE_IMPL(MIC_U) diff --git a/src/core/hle/service/mvd/mvd_std.h b/src/core/hle/service/mvd/mvd_std.h index 6e8312e59..fed41e6f0 100644 --- a/src/core/hle/service/mvd/mvd_std.h +++ b/src/core/hle/service/mvd/mvd_std.h @@ -14,11 +14,7 @@ public: ~MVD_STD() = default; private: - template - void serialize(Archive& ar, const unsigned int) { - ar& boost::serialization::base_object(*this); - } - friend class boost::serialization::access; + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::MVD diff --git a/src/core/hle/service/news/news_s.h b/src/core/hle/service/news/news_s.h index 711a0e99b..9d1ce829f 100644 --- a/src/core/hle/service/news/news_s.h +++ b/src/core/hle/service/news/news_s.h @@ -24,6 +24,8 @@ private: * 2 : Number of notifications */ void GetTotalNotifications(Kernel::HLERequestContext& ctx); + + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NEWS diff --git a/src/core/hle/service/news/news_u.h b/src/core/hle/service/news/news_u.h index 472dd579c..8e672256d 100644 --- a/src/core/hle/service/news/news_u.h +++ b/src/core/hle/service/news/news_u.h @@ -12,6 +12,9 @@ namespace Service::NEWS { class NEWS_U final : public ServiceFramework { public: NEWS_U(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NEWS diff --git a/src/core/hle/service/nim/nim_aoc.h b/src/core/hle/service/nim/nim_aoc.h index 2d06a9d1c..003b3fd85 100644 --- a/src/core/hle/service/nim/nim_aoc.h +++ b/src/core/hle/service/nim/nim_aoc.h @@ -12,6 +12,9 @@ class NIM_AOC final : public ServiceFramework { public: NIM_AOC(); ~NIM_AOC(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NIM diff --git a/src/core/hle/service/nim/nim_s.h b/src/core/hle/service/nim/nim_s.h index 6281270f5..10b041456 100644 --- a/src/core/hle/service/nim/nim_s.h +++ b/src/core/hle/service/nim/nim_s.h @@ -12,6 +12,9 @@ class NIM_S final : public ServiceFramework { public: NIM_S(); ~NIM_S(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NIM diff --git a/src/core/hle/service/nwm/nwm_cec.h b/src/core/hle/service/nwm/nwm_cec.h index 4f62f32f1..674c98cae 100644 --- a/src/core/hle/service/nwm/nwm_cec.h +++ b/src/core/hle/service/nwm/nwm_cec.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_CEC final : public ServiceFramework { public: NWM_CEC(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_ext.h b/src/core/hle/service/nwm/nwm_ext.h index a8d43df70..1e8bcfde3 100644 --- a/src/core/hle/service/nwm/nwm_ext.h +++ b/src/core/hle/service/nwm/nwm_ext.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_EXT final : public ServiceFramework { public: NWM_EXT(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_inf.h b/src/core/hle/service/nwm/nwm_inf.h index f13fd4158..9f8c65a2b 100644 --- a/src/core/hle/service/nwm/nwm_inf.h +++ b/src/core/hle/service/nwm/nwm_inf.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_INF final : public ServiceFramework { public: NWM_INF(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_sap.h b/src/core/hle/service/nwm/nwm_sap.h index 1a289542c..0422dc658 100644 --- a/src/core/hle/service/nwm/nwm_sap.h +++ b/src/core/hle/service/nwm/nwm_sap.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_SAP final : public ServiceFramework { public: NWM_SAP(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_soc.h b/src/core/hle/service/nwm/nwm_soc.h index 883a20854..f13490e83 100644 --- a/src/core/hle/service/nwm/nwm_soc.h +++ b/src/core/hle/service/nwm/nwm_soc.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_SOC final : public ServiceFramework { public: NWM_SOC(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_tst.h b/src/core/hle/service/nwm/nwm_tst.h index e58fa3371..576d4d124 100644 --- a/src/core/hle/service/nwm/nwm_tst.h +++ b/src/core/hle/service/nwm/nwm_tst.h @@ -11,6 +11,9 @@ namespace Service::NWM { class NWM_TST final : public ServiceFramework { public: NWM_TST(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::NWM diff --git a/src/core/hle/service/nwm/nwm_uds.cpp b/src/core/hle/service/nwm/nwm_uds.cpp index eef8cbd1d..2aa64f7fc 100644 --- a/src/core/hle/service/nwm/nwm_uds.cpp +++ b/src/core/hle/service/nwm/nwm_uds.cpp @@ -28,6 +28,7 @@ namespace Service::NWM { template void NWM_UDS::serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); ar& node_map; ar& connection_event; ar& received_beacons; diff --git a/src/core/hle/service/pm/pm_app.h b/src/core/hle/service/pm/pm_app.h index 0fb290aba..9aefb0cee 100644 --- a/src/core/hle/service/pm/pm_app.h +++ b/src/core/hle/service/pm/pm_app.h @@ -12,6 +12,9 @@ class PM_APP final : public ServiceFramework { public: PM_APP(); ~PM_APP() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::PM diff --git a/src/core/hle/service/pm/pm_dbg.h b/src/core/hle/service/pm/pm_dbg.h index 1cfdea6fe..3a6e3c5c7 100644 --- a/src/core/hle/service/pm/pm_dbg.h +++ b/src/core/hle/service/pm/pm_dbg.h @@ -12,6 +12,9 @@ class PM_DBG final : public ServiceFramework { public: PM_DBG(); ~PM_DBG() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::PM diff --git a/src/core/hle/service/ps/ps_ps.h b/src/core/hle/service/ps/ps_ps.h index 39f6d62b2..f5005d444 100644 --- a/src/core/hle/service/ps/ps_ps.h +++ b/src/core/hle/service/ps/ps_ps.h @@ -18,6 +18,8 @@ public: ~PS_PS() = default; private: + SERVICE_SERIALIZATION_SIMPLE + /** * PS_PS::SignRsaSha256 service function * Inputs: diff --git a/src/core/hle/service/pxi/dev.h b/src/core/hle/service/pxi/dev.h index ed17435b6..f16491077 100644 --- a/src/core/hle/service/pxi/dev.h +++ b/src/core/hle/service/pxi/dev.h @@ -13,6 +13,9 @@ class DEV final : public ServiceFramework { public: DEV(); ~DEV(); + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::PXI diff --git a/src/core/hle/service/qtm/qtm_c.h b/src/core/hle/service/qtm/qtm_c.h index 8ad05b6e1..b601cd9de 100644 --- a/src/core/hle/service/qtm/qtm_c.h +++ b/src/core/hle/service/qtm/qtm_c.h @@ -12,6 +12,9 @@ class QTM_C final : public ServiceFramework { public: QTM_C(); ~QTM_C() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::QTM diff --git a/src/core/hle/service/qtm/qtm_s.h b/src/core/hle/service/qtm/qtm_s.h index 51e1a4bc8..b32a497db 100644 --- a/src/core/hle/service/qtm/qtm_s.h +++ b/src/core/hle/service/qtm/qtm_s.h @@ -12,6 +12,9 @@ class QTM_S final : public ServiceFramework { public: QTM_S(); ~QTM_S() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::QTM diff --git a/src/core/hle/service/qtm/qtm_sp.h b/src/core/hle/service/qtm/qtm_sp.h index 3c16dea37..2f290f192 100644 --- a/src/core/hle/service/qtm/qtm_sp.h +++ b/src/core/hle/service/qtm/qtm_sp.h @@ -12,6 +12,9 @@ class QTM_SP final : public ServiceFramework { public: QTM_SP(); ~QTM_SP() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::QTM diff --git a/src/core/hle/service/qtm/qtm_u.h b/src/core/hle/service/qtm/qtm_u.h index f6b54c8af..d1aee1e97 100644 --- a/src/core/hle/service/qtm/qtm_u.h +++ b/src/core/hle/service/qtm/qtm_u.h @@ -12,6 +12,9 @@ class QTM_U final : public ServiceFramework { public: QTM_U(); ~QTM_U() = default; + +private: + SERVICE_SERIALIZATION_SIMPLE }; } // namespace Service::QTM diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index d39e72aca..0261d061f 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -219,6 +219,13 @@ extern const std::array service_module_map; friend class boost::serialization::access; \ friend class ::construct_access; +#define SERVICE_SERIALIZATION_SIMPLE \ + template \ + void serialize(Archive& ar, const unsigned int) { \ + ar& boost::serialization::base_object(*this); \ + } \ + friend class boost::serialization::access; + #define SERVICE_CONSTRUCT(T) \ namespace boost::serialization { \ template \ diff --git a/src/core/hle/service/ssl_c.h b/src/core/hle/service/ssl_c.h index 3984f7ecc..30b87378a 100644 --- a/src/core/hle/service/ssl_c.h +++ b/src/core/hle/service/ssl_c.h @@ -23,6 +23,8 @@ private: // TODO: Implement a proper CSPRNG in the future when actual security is needed std::mt19937 rand_gen; + + SERVICE_SERIALIZATION_SIMPLE }; void InstallInterfaces(Core::System& system); diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 0c981b545..45e7da13d 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -20,6 +20,7 @@ namespace Service::Y2R { template void Y2R_U::serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); ar& completion_event; ar& conversion; ar& dithering_weight_params; diff --git a/src/core/memory.cpp b/src/core/memory.cpp index cd3cf8aed..4c083d8c0 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -170,7 +170,9 @@ private: MemorySystem::Impl& impl; template - void serialize(Archive& ar, const unsigned int) {} + void serialize(Archive& ar, const unsigned int) { + ar& boost::serialization::base_object(*this); + } friend class boost::serialization::access; };