1
0
Fork 0

Serialize PTM service

This commit is contained in:
Hamish Milne 2020-01-01 22:36:58 +00:00 committed by zhupengfei
parent f5e2f873b0
commit 92857efca4
17 changed files with 77 additions and 3 deletions

4
TODO
View File

@ -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)

View File

@ -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) {

View File

@ -15,3 +15,5 @@ public:
};
} // namespace Service::PM
BOOST_CLASS_EXPORT_KEY(Service::PM::PM_APP)

View File

@ -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) {

View File

@ -15,3 +15,5 @@ public:
};
} // namespace Service::PM
BOOST_CLASS_EXPORT_KEY(Service::PM::PM_DBG)

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <cinttypes>
#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

View File

@ -137,7 +137,7 @@ public:
*/
void CheckNew3DS(Kernel::HLERequestContext& ctx);
private:
protected:
std::shared_ptr<Module> ptm;
};
@ -145,8 +145,18 @@ private:
bool shell_open = true;
bool battery_is_charging = true;
bool pedometer_is_counting = false;
template <class Archive>
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)

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/ptm/ptm_gets.h"
SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Gets)
namespace Service::PTM {
PTM_Gets::PTM_Gets(std::shared_ptr<Module> ptm)

View File

@ -12,6 +12,12 @@ namespace Service::PTM {
class PTM_Gets final : public Module::Interface {
public:
explicit PTM_Gets(std::shared_ptr<Module> 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)

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/ptm/ptm_play.h"
SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Play)
namespace Service::PTM {
PTM_Play::PTM_Play(std::shared_ptr<Module> ptm)

View File

@ -12,6 +12,12 @@ namespace Service::PTM {
class PTM_Play final : public Module::Interface {
public:
explicit PTM_Play(std::shared_ptr<Module> 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)

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/ptm/ptm_sets.h"
SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_Sets)
namespace Service::PTM {
PTM_Sets::PTM_Sets(std::shared_ptr<Module> ptm) : Module::Interface(std::move(ptm), "ptm:sets", 1) {

View File

@ -12,6 +12,12 @@ namespace Service::PTM {
class PTM_Sets final : public Module::Interface {
public:
explicit PTM_Sets(std::shared_ptr<Module> 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)

View File

@ -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<Module> ptm, const char* name)

View File

@ -17,11 +17,22 @@ public:
class PTM_S final : public PTM_S_Common {
public:
explicit PTM_S(std::shared_ptr<Module> ptm);
private:
SERVICE_SERIALIZATION(PTM_S, ptm, Module)
};
class PTM_Sysm final : public PTM_S_Common {
public:
explicit PTM_Sysm(std::shared_ptr<Module> 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)

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/ptm/ptm_u.h"
SERIALIZE_EXPORT_IMPL(Service::PTM::PTM_U)
namespace Service::PTM {
PTM_U::PTM_U(std::shared_ptr<Module> ptm) : Module::Interface(std::move(ptm), "ptm:u", 26) {

View File

@ -12,6 +12,12 @@ namespace Service::PTM {
class PTM_U final : public Module::Interface {
public:
explicit PTM_U(std::shared_ptr<Module> 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)