PTM Services

PTM Services

A total of 24 sessions can be open for each of these services combined. The commands for each service are handled by the PTM module main() thread.

User PTM Service “ptm:u” / PTM services #

Command HeaderDescription
0x00010002RegisterAlarmClient
0x00020080SetRtcAlarm
0x00030000GetRtcAlarm
0x00040000CancelRtcAlarm
0x00050000GetAdapterState
0x00060000GetShellState
0x00070000GetBatteryLevel
0x00080000GetBatteryChargeState
0x00090000GetPedometerState
0x000A0042GetStepHistoryEntry
0x000B00C2GetStepHistory
0x000C0000GetTotalStepCount
0x000D0040SetPedometerRecordingMode
0x000E0000GetPedometerRecordingMode
0x000F0084GetStepHistoryAll

The above commands are available for all PTM services, except the SetSystemTime service.

PlayHistory PTM Service “ptm:play” #

Command HeaderDescription
0x08070082GetPlayHistory
0x08080000GetPlayHistoryStart
0x08090000GetPlayHistoryLength
0x080B0080CalcPlayHistoryStart

SystemControl PTM Service “ptm:s” #

Identical to the below “ptm:sysm”

SysMenu PTM Service “ptm:sysm” #

Command HeaderDescription
0x040100C0SetRtcAlarmEx
0x04020042ReplySleepQuery
0x04030042NotifySleepPreparationComplete
0x04040102SetWakeupTrigger
0x04050000GetAwakeReason
0x04060000RequestSleep
0x040700C0ShutdownAsync
0x04080000Awake
0x04090080RebootAsync
0x040A0000CheckNew3DS (Added with 8.0.0-18)
0x08010640SetInfoLEDPattern (These 4 LED commands are used for the notification LED, see MCU regarding boot fail with invalid parameters)
0x08020040SetInfoLEDPatternHeader
0x08030000GetInfoLEDStatus
0x08040040SetBatteryEmptyLEDPattern
0x08050000ClearStepHistory
0x080600C2SetStepHistory
0x08070082GetPlayHistory
0x08080000GetPlayHistoryStart
0x08090000GetPlayHistoryLength
0x080A0000ClearPlayHistory
0x080B0080CalcPlayHistoryStart
0x080C0080SetUserTime
0x080D0000InvalidateSystemTime
0x080E0140NotifyPlayEvent
0x080F0000GetSoftwareClosedFlag
0x08100000ClearSoftwareClosedFlag
0x08110000GetShellStatus
0x08120000IsShutdownByBatteryEmpty
0x08130000FormatSavedata
0x08140000GetLegacyJumpProhibitedFlag
0x08150040SetPlayHistoryRecordingMode
0x0816….Abstraction for mcu::RTC::GetSystemClock
0x0817….Abstraction for mcu::RTC::SetSystemClock
0x08180040ConfigureNew3DSCPU

GetSystemTime PTM Service “ptm:gets” #

Command HeaderDescription
0x04010000GetSystemTime

SetSystemTime PTM Service “ptm:sets” #

Command HeaderDescription
0x00010080SetSystemTime

PTM System_SaveData #

Main article: PTM Savegame

During system boot PTM attempts to open the PTM savedata, if this fails it will repeatedly keep trying to open the archive. When opening the archive is failing due to savedata corruption, PTM eventually (during system boot) deletes the savedata then creates it again.

Savedata contents:

  • “/Pedometer.dat”
  • “/PlayHistory.dat” Filesize is 0xD5DE8.