diff options
| author | 2016-12-08 19:34:32 -0800 | |
|---|---|---|
| committer | 2016-12-08 19:34:32 -0800 | |
| commit | 18bf4acb9bc5b1ee79f757ea604efd8f10eac7cf (patch) | |
| tree | e230f60ef4ae620bce849da9f72ee7e397c0de1a /src | |
| parent | Merge pull request #2280 from Subv/citrace_size (diff) | |
| parent | service: Add the ptm:s service (diff) | |
| download | yuzu-18bf4acb9bc5b1ee79f757ea604efd8f10eac7cf.tar.gz yuzu-18bf4acb9bc5b1ee79f757ea604efd8f10eac7cf.tar.xz yuzu-18bf4acb9bc5b1ee79f757ea604efd8f10eac7cf.zip | |
Merge pull request #2287 from lioncash/svc
service: Minor PTM changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_gets.cpp | 37 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_gets.h | 22 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_play.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_play.h | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_sets.cpp | 20 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_sets.h | 22 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_sysm.cpp | 23 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_sysm.h | 13 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_u.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_u.h | 4 |
12 files changed, 170 insertions, 12 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3dd3310cb..c2c04473c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -123,7 +123,9 @@ set(SRCS | |||
| 123 | hle/service/nwm_uds.cpp | 123 | hle/service/nwm_uds.cpp |
| 124 | hle/service/pm_app.cpp | 124 | hle/service/pm_app.cpp |
| 125 | hle/service/ptm/ptm.cpp | 125 | hle/service/ptm/ptm.cpp |
| 126 | hle/service/ptm/ptm_gets.cpp | ||
| 126 | hle/service/ptm/ptm_play.cpp | 127 | hle/service/ptm/ptm_play.cpp |
| 128 | hle/service/ptm/ptm_sets.cpp | ||
| 127 | hle/service/ptm/ptm_sysm.cpp | 129 | hle/service/ptm/ptm_sysm.cpp |
| 128 | hle/service/ptm/ptm_u.cpp | 130 | hle/service/ptm/ptm_u.cpp |
| 129 | hle/service/qtm/qtm.cpp | 131 | hle/service/qtm/qtm.cpp |
| @@ -283,7 +285,9 @@ set(HEADERS | |||
| 283 | hle/service/nwm_uds.h | 285 | hle/service/nwm_uds.h |
| 284 | hle/service/pm_app.h | 286 | hle/service/pm_app.h |
| 285 | hle/service/ptm/ptm.h | 287 | hle/service/ptm/ptm.h |
| 288 | hle/service/ptm/ptm_gets.h | ||
| 286 | hle/service/ptm/ptm_play.h | 289 | hle/service/ptm/ptm_play.h |
| 290 | hle/service/ptm/ptm_sets.h | ||
| 287 | hle/service/ptm/ptm_sysm.h | 291 | hle/service/ptm/ptm_sysm.h |
| 288 | hle/service/ptm/ptm_u.h | 292 | hle/service/ptm/ptm_u.h |
| 289 | hle/service/qtm/qtm.h | 293 | hle/service/qtm/qtm.h |
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 6a9f1d24d..4d374ba17 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp | |||
| @@ -6,7 +6,9 @@ | |||
| 6 | #include "core/file_sys/file_backend.h" | 6 | #include "core/file_sys/file_backend.h" |
| 7 | #include "core/hle/service/fs/archive.h" | 7 | #include "core/hle/service/fs/archive.h" |
| 8 | #include "core/hle/service/ptm/ptm.h" | 8 | #include "core/hle/service/ptm/ptm.h" |
| 9 | #include "core/hle/service/ptm/ptm_gets.h" | ||
| 9 | #include "core/hle/service/ptm/ptm_play.h" | 10 | #include "core/hle/service/ptm/ptm_play.h" |
| 11 | #include "core/hle/service/ptm/ptm_sets.h" | ||
| 10 | #include "core/hle/service/ptm/ptm_sysm.h" | 12 | #include "core/hle/service/ptm/ptm_sysm.h" |
| 11 | #include "core/hle/service/ptm/ptm_u.h" | 13 | #include "core/hle/service/ptm/ptm_u.h" |
| 12 | #include "core/hle/service/service.h" | 14 | #include "core/hle/service/service.h" |
| @@ -106,9 +108,12 @@ void CheckNew3DS(Service::Interface* self) { | |||
| 106 | } | 108 | } |
| 107 | 109 | ||
| 108 | void Init() { | 110 | void Init() { |
| 109 | AddService(new PTM_Play_Interface); | 111 | AddService(new PTM_Gets); |
| 110 | AddService(new PTM_Sysm_Interface); | 112 | AddService(new PTM_Play); |
| 111 | AddService(new PTM_U_Interface); | 113 | AddService(new PTM_S); |
| 114 | AddService(new PTM_Sets); | ||
| 115 | AddService(new PTM_Sysm); | ||
| 116 | AddService(new PTM_U); | ||
| 112 | 117 | ||
| 113 | shell_open = true; | 118 | shell_open = true; |
| 114 | battery_is_charging = true; | 119 | battery_is_charging = true; |
diff --git a/src/core/hle/service/ptm/ptm_gets.cpp b/src/core/hle/service/ptm/ptm_gets.cpp new file mode 100644 index 000000000..b23e508d6 --- /dev/null +++ b/src/core/hle/service/ptm/ptm_gets.cpp | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/ptm/ptm.h" | ||
| 6 | #include "core/hle/service/ptm/ptm_gets.h" | ||
| 7 | |||
| 8 | namespace Service { | ||
| 9 | namespace PTM { | ||
| 10 | |||
| 11 | const Interface::FunctionInfo FunctionTable[] = { | ||
| 12 | // ptm:u common commands | ||
| 13 | {0x00010002, nullptr, "RegisterAlarmClient"}, | ||
| 14 | {0x00020080, nullptr, "SetRtcAlarm"}, | ||
| 15 | {0x00030000, nullptr, "GetRtcAlarm"}, | ||
| 16 | {0x00040000, nullptr, "CancelRtcAlarm"}, | ||
| 17 | {0x00050000, GetAdapterState, "GetAdapterState"}, | ||
| 18 | {0x00060000, GetShellState, "GetShellState"}, | ||
| 19 | {0x00070000, GetBatteryLevel, "GetBatteryLevel"}, | ||
| 20 | {0x00080000, GetBatteryChargeState, "GetBatteryChargeState"}, | ||
| 21 | {0x00090000, nullptr, "GetPedometerState"}, | ||
| 22 | {0x000A0042, nullptr, "GetStepHistoryEntry"}, | ||
| 23 | {0x000B00C2, nullptr, "GetStepHistory"}, | ||
| 24 | {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, | ||
| 25 | {0x000D0040, nullptr, "SetPedometerRecordingMode"}, | ||
| 26 | {0x000E0000, nullptr, "GetPedometerRecordingMode"}, | ||
| 27 | {0x000F0084, nullptr, "GetStepHistoryAll"}, | ||
| 28 | // ptm:gets | ||
| 29 | {0x04010000, nullptr, "GetSystemTime"}, | ||
| 30 | }; | ||
| 31 | |||
| 32 | PTM_Gets::PTM_Gets() { | ||
| 33 | Register(FunctionTable); | ||
| 34 | } | ||
| 35 | |||
| 36 | } // namespace PTM | ||
| 37 | } // namespace Service | ||
diff --git a/src/core/hle/service/ptm/ptm_gets.h b/src/core/hle/service/ptm/ptm_gets.h new file mode 100644 index 000000000..5552c9eff --- /dev/null +++ b/src/core/hle/service/ptm/ptm_gets.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace PTM { | ||
| 11 | |||
| 12 | class PTM_Gets final : public Interface { | ||
| 13 | public: | ||
| 14 | PTM_Gets(); | ||
| 15 | |||
| 16 | std::string GetPortName() const override { | ||
| 17 | return "ptm:gets"; | ||
| 18 | } | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace PTM | ||
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/ptm/ptm_play.cpp b/src/core/hle/service/ptm/ptm_play.cpp index 2e0c6e1a3..bcb00e0d4 100644 --- a/src/core/hle/service/ptm/ptm_play.cpp +++ b/src/core/hle/service/ptm/ptm_play.cpp | |||
| @@ -2,19 +2,37 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/hle/service/ptm/ptm.h" | ||
| 5 | #include "core/hle/service/ptm/ptm_play.h" | 6 | #include "core/hle/service/ptm/ptm_play.h" |
| 6 | 7 | ||
| 7 | namespace Service { | 8 | namespace Service { |
| 8 | namespace PTM { | 9 | namespace PTM { |
| 9 | 10 | ||
| 10 | const Interface::FunctionInfo FunctionTable[] = { | 11 | const Interface::FunctionInfo FunctionTable[] = { |
| 12 | // ptm:u common commands | ||
| 13 | {0x00010002, nullptr, "RegisterAlarmClient"}, | ||
| 14 | {0x00020080, nullptr, "SetRtcAlarm"}, | ||
| 15 | {0x00030000, nullptr, "GetRtcAlarm"}, | ||
| 16 | {0x00040000, nullptr, "CancelRtcAlarm"}, | ||
| 17 | {0x00050000, GetAdapterState, "GetAdapterState"}, | ||
| 18 | {0x00060000, GetShellState, "GetShellState"}, | ||
| 19 | {0x00070000, GetBatteryLevel, "GetBatteryLevel"}, | ||
| 20 | {0x00080000, GetBatteryChargeState, "GetBatteryChargeState"}, | ||
| 21 | {0x00090000, nullptr, "GetPedometerState"}, | ||
| 22 | {0x000A0042, nullptr, "GetStepHistoryEntry"}, | ||
| 23 | {0x000B00C2, nullptr, "GetStepHistory"}, | ||
| 24 | {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, | ||
| 25 | {0x000D0040, nullptr, "SetPedometerRecordingMode"}, | ||
| 26 | {0x000E0000, nullptr, "GetPedometerRecordingMode"}, | ||
| 27 | {0x000F0084, nullptr, "GetStepHistoryAll"}, | ||
| 28 | // ptm:play | ||
| 11 | {0x08070082, nullptr, "GetPlayHistory"}, | 29 | {0x08070082, nullptr, "GetPlayHistory"}, |
| 12 | {0x08080000, nullptr, "GetPlayHistoryStart"}, | 30 | {0x08080000, nullptr, "GetPlayHistoryStart"}, |
| 13 | {0x08090000, nullptr, "GetPlayHistoryLength"}, | 31 | {0x08090000, nullptr, "GetPlayHistoryLength"}, |
| 14 | {0x080B0080, nullptr, "CalcPlayHistoryStart"}, | 32 | {0x080B0080, nullptr, "CalcPlayHistoryStart"}, |
| 15 | }; | 33 | }; |
| 16 | 34 | ||
| 17 | PTM_Play_Interface::PTM_Play_Interface() { | 35 | PTM_Play::PTM_Play() { |
| 18 | Register(FunctionTable); | 36 | Register(FunctionTable); |
| 19 | } | 37 | } |
| 20 | 38 | ||
diff --git a/src/core/hle/service/ptm/ptm_play.h b/src/core/hle/service/ptm/ptm_play.h index 47f229581..663faabee 100644 --- a/src/core/hle/service/ptm/ptm_play.h +++ b/src/core/hle/service/ptm/ptm_play.h | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace PTM { | 10 | namespace PTM { |
| 11 | 11 | ||
| 12 | class PTM_Play_Interface : public Service::Interface { | 12 | class PTM_Play final : public Interface { |
| 13 | public: | 13 | public: |
| 14 | PTM_Play_Interface(); | 14 | PTM_Play(); |
| 15 | 15 | ||
| 16 | std::string GetPortName() const override { | 16 | std::string GetPortName() const override { |
| 17 | return "ptm:play"; | 17 | return "ptm:play"; |
diff --git a/src/core/hle/service/ptm/ptm_sets.cpp b/src/core/hle/service/ptm/ptm_sets.cpp new file mode 100644 index 000000000..a8c6cf227 --- /dev/null +++ b/src/core/hle/service/ptm/ptm_sets.cpp | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "core/hle/service/ptm/ptm_sets.h" | ||
| 6 | |||
| 7 | namespace Service { | ||
| 8 | namespace PTM { | ||
| 9 | |||
| 10 | const Interface::FunctionInfo FunctionTable[] = { | ||
| 11 | // Note that this service does not have access to ptm:u's common commands | ||
| 12 | {0x00010080, nullptr, "SetSystemTime"}, | ||
| 13 | }; | ||
| 14 | |||
| 15 | PTM_Sets::PTM_Sets() { | ||
| 16 | Register(FunctionTable); | ||
| 17 | } | ||
| 18 | |||
| 19 | } // namespace PTM | ||
| 20 | } // namespace Service | ||
diff --git a/src/core/hle/service/ptm/ptm_sets.h b/src/core/hle/service/ptm/ptm_sets.h new file mode 100644 index 000000000..d33b047e5 --- /dev/null +++ b/src/core/hle/service/ptm/ptm_sets.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service { | ||
| 10 | namespace PTM { | ||
| 11 | |||
| 12 | class PTM_Sets final : public Interface { | ||
| 13 | public: | ||
| 14 | PTM_Sets(); | ||
| 15 | |||
| 16 | std::string GetPortName() const override { | ||
| 17 | return "ptm:sets"; | ||
| 18 | } | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace PTM | ||
| 22 | } // namespace Service | ||
diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp index 82e118e2b..f95dfdbb1 100644 --- a/src/core/hle/service/ptm/ptm_sysm.cpp +++ b/src/core/hle/service/ptm/ptm_sysm.cpp | |||
| @@ -9,6 +9,23 @@ namespace Service { | |||
| 9 | namespace PTM { | 9 | namespace PTM { |
| 10 | 10 | ||
| 11 | const Interface::FunctionInfo FunctionTable[] = { | 11 | const Interface::FunctionInfo FunctionTable[] = { |
| 12 | // ptm:u common commands | ||
| 13 | {0x00010002, nullptr, "RegisterAlarmClient"}, | ||
| 14 | {0x00020080, nullptr, "SetRtcAlarm"}, | ||
| 15 | {0x00030000, nullptr, "GetRtcAlarm"}, | ||
| 16 | {0x00040000, nullptr, "CancelRtcAlarm"}, | ||
| 17 | {0x00050000, GetAdapterState, "GetAdapterState"}, | ||
| 18 | {0x00060000, GetShellState, "GetShellState"}, | ||
| 19 | {0x00070000, GetBatteryLevel, "GetBatteryLevel"}, | ||
| 20 | {0x00080000, GetBatteryChargeState, "GetBatteryChargeState"}, | ||
| 21 | {0x00090000, nullptr, "GetPedometerState"}, | ||
| 22 | {0x000A0042, nullptr, "GetStepHistoryEntry"}, | ||
| 23 | {0x000B00C2, nullptr, "GetStepHistory"}, | ||
| 24 | {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, | ||
| 25 | {0x000D0040, nullptr, "SetPedometerRecordingMode"}, | ||
| 26 | {0x000E0000, nullptr, "GetPedometerRecordingMode"}, | ||
| 27 | {0x000F0084, nullptr, "GetStepHistoryAll"}, | ||
| 28 | // ptm:sysm | ||
| 12 | {0x040100C0, nullptr, "SetRtcAlarmEx"}, | 29 | {0x040100C0, nullptr, "SetRtcAlarmEx"}, |
| 13 | {0x04020042, nullptr, "ReplySleepQuery"}, | 30 | {0x04020042, nullptr, "ReplySleepQuery"}, |
| 14 | {0x04030042, nullptr, "NotifySleepPreparationComplete"}, | 31 | {0x04030042, nullptr, "NotifySleepPreparationComplete"}, |
| @@ -42,7 +59,11 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 42 | {0x08180040, nullptr, "ConfigureNew3DSCPU"}, | 59 | {0x08180040, nullptr, "ConfigureNew3DSCPU"}, |
| 43 | }; | 60 | }; |
| 44 | 61 | ||
| 45 | PTM_Sysm_Interface::PTM_Sysm_Interface() { | 62 | PTM_S::PTM_S() { |
| 63 | Register(FunctionTable); | ||
| 64 | } | ||
| 65 | |||
| 66 | PTM_Sysm::PTM_Sysm() { | ||
| 46 | Register(FunctionTable); | 67 | Register(FunctionTable); |
| 47 | } | 68 | } |
| 48 | 69 | ||
diff --git a/src/core/hle/service/ptm/ptm_sysm.h b/src/core/hle/service/ptm/ptm_sysm.h index e37f20546..8afcebbba 100644 --- a/src/core/hle/service/ptm/ptm_sysm.h +++ b/src/core/hle/service/ptm/ptm_sysm.h | |||
| @@ -9,9 +9,18 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace PTM { | 10 | namespace PTM { |
| 11 | 11 | ||
| 12 | class PTM_Sysm_Interface : public Interface { | 12 | class PTM_S final : public Interface { |
| 13 | public: | 13 | public: |
| 14 | PTM_Sysm_Interface(); | 14 | PTM_S(); |
| 15 | |||
| 16 | std::string GetPortName() const override { | ||
| 17 | return "ptm:s"; | ||
| 18 | } | ||
| 19 | }; | ||
| 20 | |||
| 21 | class PTM_Sysm final : public Interface { | ||
| 22 | public: | ||
| 23 | PTM_Sysm(); | ||
| 15 | 24 | ||
| 16 | std::string GetPortName() const override { | 25 | std::string GetPortName() const override { |
| 17 | return "ptm:sysm"; | 26 | return "ptm:sysm"; |
diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 65e868393..e0b65ba89 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp | |||
| @@ -26,7 +26,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 26 | {0x000F0084, nullptr, "GetStepHistoryAll"}, | 26 | {0x000F0084, nullptr, "GetStepHistoryAll"}, |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | PTM_U_Interface::PTM_U_Interface() { | 29 | PTM_U::PTM_U() { |
| 30 | Register(FunctionTable); | 30 | Register(FunctionTable); |
| 31 | } | 31 | } |
| 32 | 32 | ||
diff --git a/src/core/hle/service/ptm/ptm_u.h b/src/core/hle/service/ptm/ptm_u.h index bf132f610..7b75d6e49 100644 --- a/src/core/hle/service/ptm/ptm_u.h +++ b/src/core/hle/service/ptm/ptm_u.h | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | namespace Service { | 9 | namespace Service { |
| 10 | namespace PTM { | 10 | namespace PTM { |
| 11 | 11 | ||
| 12 | class PTM_U_Interface : public Interface { | 12 | class PTM_U final : public Interface { |
| 13 | public: | 13 | public: |
| 14 | PTM_U_Interface(); | 14 | PTM_U(); |
| 15 | 15 | ||
| 16 | std::string GetPortName() const override { | 16 | std::string GetPortName() const override { |
| 17 | return "ptm:u"; | 17 | return "ptm:u"; |