diff --git a/TODO b/TODO index 1f29a4693..0b7d5dd36 100644 --- a/TODO +++ b/TODO @@ -101,9 +101,9 @@ ✔ NS @done(20-01-01 00:46) ✔ NWM @done(20-01-01 21:31) ☐ Fix wifi_packet_received? - ☐ PM + ✔ PM @done(20-01-01 22:14) ✔ PS @done(20-01-01 00:54) - ☐ PTM + ✔ PTM @done(20-01-01 22:36) ✔ PXI @done(20-01-01 00:53) ☐ QTM ✔ SOC @done(20-01-01 00:51) diff --git a/src/core/hle/service/pm/pm_app.cpp b/src/core/hle/service/pm/pm_app.cpp index 9599dfcfc..fd0858356 100644 --- a/src/core/hle/service/pm/pm_app.cpp +++ b/src/core/hle/service/pm/pm_app.cpp @@ -2,9 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/archives.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/pm/pm_app.h" +SERIALIZE_EXPORT_IMPL(Service::PM::PM_APP) + namespace Service::PM { PM_APP::PM_APP() : ServiceFramework("pm:app", 3) { diff --git a/src/core/hle/service/pm/pm_app.h b/src/core/hle/service/pm/pm_app.h index 8c7e375f0..0fb290aba 100644 --- a/src/core/hle/service/pm/pm_app.h +++ b/src/core/hle/service/pm/pm_app.h @@ -15,3 +15,5 @@ public: }; } // namespace Service::PM + +BOOST_CLASS_EXPORT_KEY(Service::PM::PM_APP) diff --git a/src/core/hle/service/pm/pm_dbg.cpp b/src/core/hle/service/pm/pm_dbg.cpp index 63879ff20..33e195a6f 100644 --- a/src/core/hle/service/pm/pm_dbg.cpp +++ b/src/core/hle/service/pm/pm_dbg.cpp @@ -2,9 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/archives.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/pm/pm_dbg.h" +SERIALIZE_EXPORT_IMPL(Service::PM::PM_DBG) + namespace Service::PM { PM_DBG::PM_DBG() : ServiceFramework("pm:dbg", 3) { diff --git a/src/core/hle/service/pm/pm_dbg.h b/src/core/hle/service/pm/pm_dbg.h index 77b644969..1cfdea6fe 100644 --- a/src/core/hle/service/pm/pm_dbg.h +++ b/src/core/hle/service/pm/pm_dbg.h @@ -15,3 +15,5 @@ public: }; } // namespace Service::PM + +BOOST_CLASS_EXPORT_KEY(Service::PM::PM_DBG) diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 7d30fcc5b..69b51480b 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -3,6 +3,7 @@ // Refer to the license.txt file included. #include +#include "common/archives.h" #include "common/common_paths.h" #include "common/file_util.h" #include "common/logging/log.h" @@ -18,6 +19,8 @@ #include "core/hle/service/ptm/ptm_u.h" #include "core/settings.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::Module) + namespace Service::PTM { /// Values for the default gamecoin.dat file diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index 549e69353..ba23224d7 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -137,7 +137,7 @@ public: */ void CheckNew3DS(Kernel::HLERequestContext& ctx); - private: + protected: std::shared_ptr ptm; }; @@ -145,8 +145,18 @@ private: bool shell_open = true; bool battery_is_charging = true; bool pedometer_is_counting = false; + + template + void serialize(Archive& ar, const unsigned int) { + ar& shell_open; + ar& battery_is_charging; + ar& pedometer_is_counting; + } + friend class boost::serialization::access; }; void InstallInterfaces(Core::System& system); } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::Module) diff --git a/src/core/hle/service/ptm/ptm_gets.cpp b/src/core/hle/service/ptm/ptm_gets.cpp index e083aed6a..6feedbf94 100644 --- a/src/core/hle/service/ptm/ptm_gets.cpp +++ b/src/core/hle/service/ptm/ptm_gets.cpp @@ -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/ptm/ptm_gets.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Gets) + namespace Service::PTM { PTM_Gets::PTM_Gets(std::shared_ptr ptm) diff --git a/src/core/hle/service/ptm/ptm_gets.h b/src/core/hle/service/ptm/ptm_gets.h index a8d71fdc9..57b8e5f55 100644 --- a/src/core/hle/service/ptm/ptm_gets.h +++ b/src/core/hle/service/ptm/ptm_gets.h @@ -12,6 +12,12 @@ namespace Service::PTM { class PTM_Gets final : public Module::Interface { public: explicit PTM_Gets(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_Gets, ptm, Module) }; } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_Gets) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_Gets) diff --git a/src/core/hle/service/ptm/ptm_play.cpp b/src/core/hle/service/ptm/ptm_play.cpp index 6ef45780e..00585ccce 100644 --- a/src/core/hle/service/ptm/ptm_play.cpp +++ b/src/core/hle/service/ptm/ptm_play.cpp @@ -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/ptm/ptm_play.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Play) + namespace Service::PTM { PTM_Play::PTM_Play(std::shared_ptr ptm) diff --git a/src/core/hle/service/ptm/ptm_play.h b/src/core/hle/service/ptm/ptm_play.h index 3a226149d..091e91d30 100644 --- a/src/core/hle/service/ptm/ptm_play.h +++ b/src/core/hle/service/ptm/ptm_play.h @@ -12,6 +12,12 @@ namespace Service::PTM { class PTM_Play final : public Module::Interface { public: explicit PTM_Play(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_Play, ptm, Module) }; } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_Play) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_Play) diff --git a/src/core/hle/service/ptm/ptm_sets.cpp b/src/core/hle/service/ptm/ptm_sets.cpp index b925f49c9..e0f436ddc 100644 --- a/src/core/hle/service/ptm/ptm_sets.cpp +++ b/src/core/hle/service/ptm/ptm_sets.cpp @@ -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/ptm/ptm_sets.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Sets) + namespace Service::PTM { PTM_Sets::PTM_Sets(std::shared_ptr ptm) : Module::Interface(std::move(ptm), "ptm:sets", 1) { diff --git a/src/core/hle/service/ptm/ptm_sets.h b/src/core/hle/service/ptm/ptm_sets.h index 317781faf..573b20dbd 100644 --- a/src/core/hle/service/ptm/ptm_sets.h +++ b/src/core/hle/service/ptm/ptm_sets.h @@ -12,6 +12,12 @@ namespace Service::PTM { class PTM_Sets final : public Module::Interface { public: explicit PTM_Sets(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_Sets, ptm, Module) }; } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_Sets) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_Sets) diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp index 45ee1b6fc..48b44104e 100644 --- a/src/core/hle/service/ptm/ptm_sysm.cpp +++ b/src/core/hle/service/ptm/ptm_sysm.cpp @@ -2,8 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/archives.h" #include "core/hle/service/ptm/ptm_sysm.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_S) +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Sysm) + namespace Service::PTM { PTM_S_Common::PTM_S_Common(std::shared_ptr ptm, const char* name) diff --git a/src/core/hle/service/ptm/ptm_sysm.h b/src/core/hle/service/ptm/ptm_sysm.h index 8667f2a95..1e01fdb2e 100644 --- a/src/core/hle/service/ptm/ptm_sysm.h +++ b/src/core/hle/service/ptm/ptm_sysm.h @@ -17,11 +17,22 @@ public: class PTM_S final : public PTM_S_Common { public: explicit PTM_S(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_S, ptm, Module) }; class PTM_Sysm final : public PTM_S_Common { public: explicit PTM_Sysm(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_Sysm, ptm, Module) }; } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_S) +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_Sysm) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_S) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_Sysm) diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 647ef5961..4c1820df4 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -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/ptm/ptm_u.h" +SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_U) + namespace Service::PTM { PTM_U::PTM_U(std::shared_ptr ptm) : Module::Interface(std::move(ptm), "ptm:u", 26) { diff --git a/src/core/hle/service/ptm/ptm_u.h b/src/core/hle/service/ptm/ptm_u.h index 618401cec..213972242 100644 --- a/src/core/hle/service/ptm/ptm_u.h +++ b/src/core/hle/service/ptm/ptm_u.h @@ -12,6 +12,12 @@ namespace Service::PTM { class PTM_U final : public Module::Interface { public: explicit PTM_U(std::shared_ptr ptm); + +private: + SERVICE_SERIALIZATION(PTM_U, ptm, Module) }; } // namespace Service::PTM + +BOOST_CLASS_EXPORT_KEY(Service::PTM::PTM_U) +BOOST_SERIALIZATION_CONSTRUCT(Service::PTM::PTM_U)