From f61c9da7d3cda3a13b40dce8657da4cfcc848aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filiph=20Sandstr=C3=B6m?= Date: Fri, 23 Oct 2015 23:50:51 +0200 Subject: [PATCH 1/4] Update ptm.h --- src/core/hle/service/ptm/ptm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index b690003cb..0dc35480d 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -71,6 +71,14 @@ void GetBatteryLevel(Interface* self); */ void GetBatteryChargeState(Interface* self); +/** + * PTM::GetBatteryChargeState service function + * Outputs: + * 1 : Result of function, 0 on success, otherwise error code + * 2 : Output of function, * = total step count + */ +void GetTotalStepCount(Interface* self); + /** * PTM::IsLegacyPowerOff service function * Outputs: From 844b9970b4153137e2b821e3b07dcc0800f449d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filiph=20Sandstr=C3=B6m?= Date: Fri, 23 Oct 2015 23:52:13 +0200 Subject: [PATCH 2/4] Add GetTotalStepCount Stub --- src/core/hle/service/ptm/ptm_u.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 3f5e9c7c1..09dc38c3e 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -23,7 +23,7 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00090000, nullptr, "GetPedometerState"}, {0x000A0042, nullptr, "GetStepHistoryEntry"}, {0x000B00C2, nullptr, "GetStepHistory"}, - {0x000C0000, nullptr, "GetTotalStepCount"}, + {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, {0x000D0040, nullptr, "SetPedometerRecordingMode"}, {0x000E0000, nullptr, "GetPedometerRecordingMode"}, {0x000F0084, nullptr, "GetStepHistoryAll"}, From 0c84d59a278f69df47e4c0b35a1bac1a7b947904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filiph=20Sandstr=C3=B6m?= Date: Fri, 23 Oct 2015 23:58:54 +0200 Subject: [PATCH 3/4] Fix wrong branch --- src/core/hle/service/ptm/ptm.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 2c7d49c9f..22c1093ff 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -68,6 +68,18 @@ void GetBatteryChargeState(Service::Interface* self) { LOG_WARNING(Service_PTM, "(STUBBED) called"); } +void GetTotalStepCount(Service::Interface* self) { + u32* cmd_buff = Kernel::GetCommandBuffer(); + + // TODO: This function is only a stub, + // it returns 0 as the total step count + + cmd_buff[1] = RESULT_SUCCESS.raw; + cmd_buff[2] = 0; + + LOG_WARNING(Service_PTM, "(STUBBED) called"); +} + void IsLegacyPowerOff(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); From a06a32c05d54c8941697b95ee67739a844c22814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filiph=20Sandstr=C3=B6m?= Date: Sat, 24 Oct 2015 13:17:04 +0200 Subject: [PATCH 4/4] Fix copy paste --- src/core/hle/service/ptm/ptm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index 0dc35480d..f2e76441f 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -72,7 +72,7 @@ void GetBatteryLevel(Interface* self); void GetBatteryChargeState(Interface* self); /** - * PTM::GetBatteryChargeState service function + * PTM::GetTotalStepCount service function * Outputs: * 1 : Result of function, 0 on success, otherwise error code * 2 : Output of function, * = total step count