Changes

Jump to navigation Jump to search
4,127 bytes added ,  12:58, 4 July 2018
m
Line 1: Line 1: −
=PTM service "ptm:sysm"=
+
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=
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 5: Line 7:  
!  Description
 
!  Description
 
|-
 
|-
| 0x0409....
+
| 0x00010002
| LaunchFIRMRebootSystem
+
| RegisterAlarmClient
 +
|-
 +
| 0x00020080
 +
| SetRtcAlarm
 +
|-
 +
| 0x00030000
 +
| GetRtcAlarm
 +
|-
 +
| 0x00040000
 +
| CancelRtcAlarm
 +
|-
 +
| 0x00050000
 +
| [[PTM:GetAdapterState|GetAdapterState]]
 +
|-
 +
| 0x00060000
 +
| [[PTM:GetShellState|GetShellState]]
 +
|-
 +
| 0x00070000
 +
| [[PTM:GetBatteryLevel|GetBatteryLevel]]
 +
|-
 +
| 0x00080000
 +
| [[PTM:GetBatteryChargeState|GetBatteryChargeState]]
 +
|-
 +
| 0x00090000
 +
| [[PTM:GetPedometerState|GetPedometerState]]
 +
|-
 +
| 0x000A0042
 +
| GetStepHistoryEntry
 +
|-
 +
| 0x000B00C2
 +
| [[PTM:GetStepHistory|GetStepHistory]]
 +
|-
 +
| 0x000C0000
 +
| [[PTM:GetTotalStepCount|GetTotalStepCount]]
 +
|-
 +
| 0x000D0040
 +
| SetPedometerRecordingMode
 +
|-
 +
| 0x000E0000
 +
| GetPedometerRecordingMode
 +
|-
 +
| 0x000F0084
 +
| GetStepHistoryAll
 
|}
 
|}
   −
=PTM service "ptm:s"=
+
The above commands are available for all PTM services, except the SetSystemTime service.
   −
=PTM service "ptm:u"=
+
=PlayHistory PTM Service "ptm:play" =
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x08070082
 +
| [[PTM:GetPlayHistory|GetPlayHistory]]
 +
|-
 +
| 0x08080000
 +
| GetPlayHistoryStart
 +
|-
 +
| 0x08090000
 +
| GetPlayHistoryLength
 +
|-
 +
| 0x080B0080
 +
| CalcPlayHistoryStart
 +
|}
   −
=PTM service "ptm:sets"=
+
=SystemControl PTM Service "ptm:s"=
 +
Identical to the below "ptm:sysm"
   −
=PTM service "ptm:play"=
+
=SysMenu PTM Service "ptm:sysm"=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x040100C0
 +
| SetRtcAlarmEx
 +
|-
 +
| 0x04020042
 +
| ReplySleepQuery
 +
|-
 +
| 0x04030042
 +
| NotifySleepPreparationComplete
 +
|-
 +
| 0x04040102
 +
| SetWakeupTrigger
 +
|-
 +
| 0x04050000
 +
| GetAwakeReason
 +
|-
 +
| 0x04060000
 +
| RequestSleep
 +
|-
 +
| 0x040700C0
 +
|  [[PTM:ShutdownAsync|ShutdownAsync]]
 +
|-
 +
| 0x04080000
 +
| Awake
 +
|-
 +
| 0x04090080
 +
| [[PTMSYSM:LaunchFIRMRebootSystem|RebootAsync]]
 +
|-
 +
| 0x040A0000
 +
| [[PTMSYSM:CheckNew3DS|CheckNew3DS]] (Added with [[8.0.0-18]])
 +
|-
 +
| 0x08010640
 +
| [[PTMSYSM:SetInfoLEDPattern|SetInfoLEDPattern]] (These 4 LED commands are used for the notification LED, see [[MCU]] regarding boot fail with invalid parameters)
 +
|-
 +
| 0x08020040
 +
| [[PTMSYSM:SetInfoLEDPatternHeader|SetInfoLEDPatternHeader]]
 +
|-
 +
| 0x08030000
 +
| [[PTMSYSM:GetInfoLEDStatus|GetInfoLEDStatus]]
 +
|-
 +
| 0x08040040
 +
| [[PTMSYSM:SetBatteryEmptyLEDPattern|SetBatteryEmptyLEDPattern]]
 +
|-
 +
| 0x08050000
 +
| ClearStepHistory
 +
|-
 +
| 0x080600C2
 +
| SetStepHistory
 +
|-
 +
| 0x08070082
 +
| [[PTM:GetPlayHistory|GetPlayHistory]]
 +
|-
 +
| 0x08080000
 +
| GetPlayHistoryStart
 +
|-
 +
| 0x08090000
 +
| GetPlayHistoryLength
 +
|-
 +
| 0x080A0000
 +
| ClearPlayHistory
 +
|-
 +
| 0x080B0080
 +
| CalcPlayHistoryStart
 +
|-
 +
| 0x080C0080
 +
| SetUserTime
 +
|-
 +
| 0x080D0000
 +
| InvalidateSystemTime
 +
|-
 +
| 0x080E0140
 +
| [[PTMSYSM:NotifyPlayEvent|NotifyPlayEvent]]
 +
|-
 +
| 0x080F0000
 +
| [[PTMSYSM:GetSoftwareClosedFlag|GetSoftwareClosedFlag]]
 +
|-
 +
| 0x08100000
 +
| [[PTMSYSM:ClearSoftwareClosedFlag|ClearSoftwareClosedFlag]]
 +
|-
 +
| 0x08110000
 +
| GetShellStatus
 +
|-
 +
| 0x08120000
 +
| IsShutdownByBatteryEmpty
 +
|-
 +
| 0x08130000
 +
| FormatSavedata
 +
|-
 +
| 0x08140000
 +
| GetLegacyJumpProhibitedFlag
 +
|-
 +
| 0x08150040
 +
| SetPlayHistoryRecordingMode
 +
|-
 +
| 0x0816....
 +
| Abstraction for mcu::RTC::GetSystemClock
 +
|-
 +
| 0x0817....
 +
| Abstraction for mcu::RTC::SetSystemClock
 +
|-
 +
| 0x08180040
 +
| [[PTMSYSM:ConfigureNew3DSCPU|ConfigureNew3DSCPU]]
 +
|-
 +
|}
 +
 
 +
=GetSystemTime PTM Service "ptm:gets"=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x04010000
 +
| GetSystemTime
 +
|-
 +
|}
   −
=PTM service "ptm:gets"=
+
=SetSystemTime PTM Service "ptm:sets"=
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x00010080
 +
| SetSystemTime
 +
|-
 +
|}
 +
 
 +
=PTM [[System_SaveData]]=
 +
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.
 +
 
 +
==PlayHistory.dat==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x4
 +
| Start entry index.
 +
|-
 +
| 0x4
 +
| 0x4
 +
| Total PlayHistory entries.
 +
|-
 +
| 0x8
 +
| 0xD5DE0
 +
| 0x11D28 PlayHistory entries, 0xC-bytes each.
 +
|}
 +
 
 +
===PlayHistory entry===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x8
 +
| u64 programID
 +
|-
 +
| 0x8
 +
| 0x4
 +
| u32, probably timestamp.
 +
|}
115

edits

Navigation menu