libctru  v2.4.1
am.h
Go to the documentation of this file.
1 /**
2  * @file am.h
3  * @brief AM (Application Manager) service.
4  */
5 #pragma once
6 
7 #include <3ds/services/fs.h>
8 
9 /// Contains basic information about a title.
10 typedef struct
11 {
12  u64 titleID; ///< The title's ID.
13  u64 size; ///< The title's installed size.
14  u16 version; ///< The title's version.
15  u8 unk[6]; ///< Unknown title data.
17 
18 /// Pending title status mask values.
19 enum
20 {
21  AM_STATUS_MASK_INSTALLING = BIT(0), ///< Titles currently installing.
22  AM_STATUS_MASK_AWAITING_FINALIZATION = BIT(1) ///< Titles awaiting finalization.
23 };
24 
25 /// Pending title status values.
26 typedef enum
27 {
28  AM_STATUS_ABORTED = 0x0002, ///< Install aborted.
29  AM_STATUS_SAVED = 0x0003, ///< Title saved, but not installed.
30  AM_STATUS_INSTALL_IN_PROGRESS = 0x0802, ///< Install in progress.
31  AM_STATUS_AWAITING_FINALIZATION = 0x0803 ///< Awaiting finalization.
33 
34 // Contains basic information about a pending title.
35 typedef struct
36 {
37  u64 titleId; ///< Title ID
38  u16 version; ///< Version
39  u16 status; ///< @ref AM_InstallStatus
40  u32 titleType; ///< Title Type
41  u8 unk[0x8]; ///< Unknown
43 
44 /// Pending title deletion flags.
45 enum
46 {
47  AM_DELETE_PENDING_NON_SYSTEM = BIT(0), ///< Non-system titles.
48  AM_DELETE_PENDING_SYSTEM = BIT(1) ///< System titles.
49 };
50 
51 /// Information about the TWL NAND partition.
52 typedef struct {
53  u64 capacity; ///< Total capacity.
54  u64 freeSpace; ///< Total free space.
55  u64 titlesCapacity; ///< Capacity for titles.
56  u64 titlesFreeSpace; ///< Free space for titles.
58 
59 /// Contains information about a title's content.
60 typedef struct {
61  u16 index; ///< Index of the content in the title.
62  u16 type; ///< ?
63  u32 contentId; ///< ID of the content in the title.
64  u64 size; ///< Size of the content in the title.
65  u8 flags; ///< @ref AM_ContentInfoFlags
66  u8 padding[7]; ///< Padding
68 
69 /// Title ContentInfo flags.
70 typedef enum
71 {
73  AM_CONTENT_OWNED = BIT(1) ///< ?
75 
76 /// Initializes AM. This doesn't initialize with "am:app", see amAppInit().
77 Result amInit(void);
78 
79 /// Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands.
81 
82 /// Exits AM.
83 void amExit(void);
84 
85 /// Gets the current AM session handle.
87 
88 /**
89  * @brief Gets the number of titles for a given media type.
90  * @param mediatype Media type to get titles from.
91  * @param[out] count Pointer to write the title count to.
92  */
94 
95 /**
96  * @brief Gets a list of title IDs present in a mediatype.
97  * @param[out] titlesRead Pointer to output the number of read titles to.
98  * @param mediatype Media type to get titles from.
99  * @param titleCount Number of title IDs to get.
100  * @param titleIds Buffer to output the retrieved title IDs to.
101  */
102 Result AM_GetTitleList(u32* titlesRead, FS_MediaType mediatype, u32 titleCount, u64 *titleIds);
103 
104 /**
105  * @brief Gets a list of details about installed titles.
106  * @param mediatype Media type to get titles from.
107  * @param titleCount Number of titles to list.
108  * @param titleIds List of title IDs to retrieve details for.
109  * @param titleInfo Buffer to write AM_TitleEntry's to.
110  */
111 Result AM_GetTitleInfo(FS_MediaType mediatype, u32 titleCount, u64 *titleIds, AM_TitleEntry *titleInfo);
112 
113 /**
114  * @brief Gets the number of tickets installed on the system.
115  * @param[out] count Pointer to output the ticket count to.
116  */
118 
119 /**
120  * @brief Gets a list of tickets installed on the system.
121  * @param[out] ticketsRead Pointer to output the number of read tickets to.
122  * @param ticketCount Number of tickets to read.
123  * @param skip Number of tickets to skip.
124  * @param ticketIds Buffer to output the retrieved ticket IDs to.
125  */
126 Result AM_GetTicketList(u32 *ticketsRead, u32 ticketCount, u32 skip, u64 *ticketIds);
127 
128 /**
129  * @brief Gets the number of pending titles on this system.
130  * @param[out] count Pointer to output the pending title count to.
131  * @param mediatype Media type of pending titles to count.
132  * @param statusMask Bit mask of status values to include.
133  */
134 Result AM_GetPendingTitleCount(u32 *count, FS_MediaType mediatype, u32 statusMask);
135 
136 /**
137  * @brief Gets a list of pending titles on this system.
138  * @param[out] titlesRead Pointer to output the number of read pending titles to.
139  * @param titleCount Number of pending titles to read.
140  * @param mediatype Media type of pending titles to list.
141  * @param statusMask Bit mask of status values to include.
142  * @param titleIds Buffer to output the retrieved pending title IDs to.
143  */
144 Result AM_GetPendingTitleList(u32 *titlesRead, u32 titleCount, FS_MediaType mediatype, u32 statusMask, u64 *titleIds);
145 
146 /**
147  * @brief Gets information about pending titles on this system.
148  * @param titleCount Number of pending titles to read.
149  * @param mediatype Media type of pending titles to get information on.
150  * @param titleIds IDs of the titles to get information about.
151  * @param titleInfo Buffer to output the retrieved pending title info to.
152  */
153 Result AM_GetPendingTitleInfo(u32 titleCount, FS_MediaType mediatype, u64 *titleIds, AM_PendingTitleEntry *titleInfo);
154 
155 /**
156  * @brief Gets a 32-bit device-specific ID.
157  * @param deviceID Pointer to write the device ID to.
158  */
160 
161 /**
162  * @brief Exports DSiWare to the specified filepath.
163  * @param titleID TWL titleID.
164  * @param operation DSiWare operation type.
165  * @param workbuf Work buffer.
166  * @param workbuf_size Work buffer size, must be >=0x20000.
167  * @param filepath UTF-8 filepath(converted to UTF-16 internally).
168  */
169 Result AM_ExportTwlBackup(u64 titleID, u8 operation, void* workbuf, u32 workbuf_size, const char *filepath);
170 
171 /**
172  * @brief Imports DSiWare from the specified file.
173  * @param filehandle FSUSER file handle.
174  * @param operation DSiWare operation type.
175  * @param buffer Work buffer.
176  * @param size Buffer size, must be >=0x20000.
177  */
178 Result AM_ImportTwlBackup(Handle filehandle, u8 operation, void* buffer, u32 size);
179 
180 /**
181  * @brief Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).
182  * @param filehandle FSUSER file handle.
183  * @param outinfo Output info buffer.
184  * @param outinfo_size Output info buffer size.
185  * @param workbuf Work buffer.
186  * @param workbuf_size Work buffer size.
187  * @param banner Output banner buffer.
188  * @param banner_size Output banner buffer size.
189  */
190 Result AM_ReadTwlBackupInfo(Handle filehandle, void* outinfo, u32 outinfo_size, void* workbuf, u32 workbuf_size, void* banner, u32 banner_size);
191 
192 /**
193  * @brief Retrieves information about the NAND TWL partition.
194  * @param[out] info Pointer to output the TWL partition info to.
195  */
197 
198 /**
199  * @brief Initializes the CIA install process, returning a handle to write CIA data to.
200  * @param mediatype Media type to install the CIA to.
201  * @param[out] ciaHandle Pointer to write the CIA handle to.
202  */
204 
205 /**
206  * @brief Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.
207  * @param[out] ciaHandle Pointer to write the CIA handle to.
208  */
210 
211 /**
212  * @brief Aborts the CIA install process.
213  * @param ciaHandle CIA handle to cancel.
214  */
216 
217 /**
218  * @brief Finalizes the CIA install process.
219  * @param ciaHandle CIA handle to finalize.
220  */
222 
223 /**
224  * @brief Finalizes the CIA install process without committing the title to title.db or tmp*.db.
225  * @param ciaHandle CIA handle to finalize.
226  */
228 
229 /**
230  * @brief Commits installed CIAs.
231  * @param mediaType Location of the titles to finalize.
232  * @param titleCount Number of titles to finalize.
233  * @param temp Whether the titles being finalized are in the temporary database.
234  * @param titleIds Title IDs to finalize.
235  */
236 Result AM_CommitImportPrograms(FS_MediaType mediaType, u32 titleCount, bool temp, const u64* titleIds);
237 
238 /**
239  * @brief Deletes a title.
240  * @param mediatype Media type to delete from.
241  * @param titleID ID of the title to delete.
242  */
243 Result AM_DeleteTitle(FS_MediaType mediatype, u64 titleID);
244 
245 /**
246  * @brief Deletes a title, provided that it is not a system title.
247  * @param mediatype Media type to delete from.
248  * @param titleID ID of the title to delete.
249  */
251 
252 /**
253  * @brief Deletes a ticket.
254  * @param titleID ID of the ticket to delete.
255  */
257 
258 /**
259  * @brief Deletes a pending title.
260  * @param mediatype Media type to delete from.
261  * @param titleId ID of the pending title to delete.
262  */
264 
265 /**
266  * @brief Deletes pending titles.
267  * @param mediatype Media type to delete from.
268  * @param flags Flags used to select pending titles.
269  */
271 
272 /**
273  * @brief Deletes all pending titles.
274  * @param mediatype Media type to delete from.
275  */
277 
278 /// Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)
280 
281 /**
282  * @brief Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).
283  * @param titleID Title ID of the NATIVE_FIRM to install.
284  */
286 
287 /**
288  * @brief Gets the product code of a title.
289  * @param mediatype Media type of the title.
290  * @param titleID ID of the title.
291  * @param[out] productCode Pointer to output the product code to. (length = 16)
292  */
293 Result AM_GetTitleProductCode(FS_MediaType mediatype, u64 titleId, char *productCode);
294 
295 /**
296  * @brief Gets the ext data ID of a title.
297  * @param[out] extDataId Pointer to output the ext data ID to.
298  * @param mediatype Media type of the title.
299  * @param titleID ID of the title.
300  */
301 Result AM_GetTitleExtDataId(u64 *extDataId, FS_MediaType mediatype, u64 titleId);
302 
303 /**
304  * @brief Gets an AM_TitleEntry instance for a CIA file.
305  * @param mediatype Media type that this CIA would be installed to.
306  * @param[out] titleEntry Pointer to write the AM_TitleEntry instance to.
307  * @param fileHandle Handle of the CIA file.
308  */
309 Result AM_GetCiaFileInfo(FS_MediaType mediatype, AM_TitleEntry *titleEntry, Handle fileHandle);
310 
311 /**
312  * @brief Gets the SMDH icon data of a CIA file.
313  * @param icon Buffer to store the icon data in. Must be of size 0x36C0 bytes.
314  * @param fileHandle Handle of the CIA file.
315  */
316 Result AM_GetCiaIcon(void *icon, Handle fileHandle);
317 
318 /**
319  * @brief Gets the title ID dependency list of a CIA file.
320  * @param dependencies Buffer to store dependency title IDs in. Must be of size 0x300 bytes.
321  * @param fileHandle Handle of the CIA file.
322  */
323 Result AM_GetCiaDependencies(u64 *dependencies, Handle fileHandle);
324 
325 /**
326  * @brief Gets the meta section offset of a CIA file.
327  * @param[out] metaOffset Pointer to output the meta section offset to.
328  * @param fileHandle Handle of the CIA file.
329  */
330 Result AM_GetCiaMetaOffset(u64 *metaOffset, Handle fileHandle);
331 
332 /**
333  * @brief Gets the core version of a CIA file.
334  * @param[out] coreVersion Pointer to output the core version to.
335  * @param fileHandle Handle of the CIA file.
336  */
337 Result AM_GetCiaCoreVersion(u32 *coreVersion, Handle fileHandle);
338 
339 /**
340  * @brief Gets the free space, in bytes, required to install a CIA file.
341  * @param[out] requiredSpace Pointer to output the required free space to.
342  * @param mediaType Media type to check free space needed to install to.
343  * @param fileHandle Handle of the CIA file.
344  */
345 Result AM_GetCiaRequiredSpace(u64 *requiredSpace, FS_MediaType mediaType, Handle fileHandle);
346 
347 /**
348  * @brief Gets the full meta section of a CIA file.
349  * @param meta Buffer to store the meta section in.
350  * @param size Size of the buffer. Must be greater than or equal to the actual section data's size.
351  * @param fileHandle Handle of the CIA file.
352  */
353 Result AM_GetCiaMetaSection(void *meta, u32 size, Handle fileHandle);
354 
355 /**
356  * @brief Initializes the external (SD) title database.
357  * @param overwrite Overwrites the database if it already exists.
358  */
360 
361 /**
362  * @brief Queries whether the external title database is available.
363  * @param[out] available Pointer to output the availability status to.
364  */
366 
367 /**
368  * @brief Begins installing a ticket.
369  * @param[out] ticketHandle Pointer to output a handle to write ticket data to.
370  */
372 
373 /**
374  * @brief Aborts installing a ticket.
375  * @param ticketHandle Handle of the installation to abort.
376  */
378 
379 /**
380  * @brief Finishes installing a ticket.
381  * @param ticketHandle Handle of the installation to finalize.
382  */
384 
385 /**
386  * @brief Begins installing a title.
387  * @param mediaType Destination to install to.
388  * @param titleId ID of the title to install.
389  * @param unk Unknown. (usually false)
390  */
391 Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId, bool unk);
392 
393 /// Stops installing a title, generally to be resumed later.
395 
396 /**
397  * @brief Resumes installing a title.
398  * @param mediaType Destination to install to.
399  * @param titleId ID of the title to install.
400  */
402 
403 /// Aborts installing a title.
405 
406 /// Finishes installing a title.
408 
409 /**
410  * @brief Commits installed titles.
411  * @param mediaType Location of the titles to finalize.
412  * @param titleCount Number of titles to finalize.
413  * @param temp Whether the titles being finalized are in the temporary database.
414  * @param titleIds Title IDs to finalize.
415  */
416 Result AM_CommitImportTitles(FS_MediaType mediaType, u32 titleCount, bool temp, const u64* titleIds);
417 
418 /**
419  * @brief Begins installing a TMD.
420  * @param[out] tmdHandle Pointer to output a handle to write TMD data to.
421  */
423 
424 /**
425  * @brief Aborts installing a TMD.
426  * @param tmdHandle Handle of the installation to abort.
427  */
429 
430 /**
431  * @brief Finishes installing a TMD.
432  * @param tmdHandle Handle of the installation to finalize.
433  * @param unk Unknown. (usually true)
434  */
435 Result AM_InstallTmdFinish(Handle tmdHandle, bool unk);
436 
437 /**
438  * @brief Prepares to import title contents.
439  * @param contentCount Number of contents to be imported.
440  * @param contentIndices Indices of the contents to be imported.
441  */
442 Result AM_CreateImportContentContexts(u32 contentCount, u16* contentIndices);
443 
444 /**
445  * @brief Begins installing title content.
446  * @param[out] contentHandle Pointer to output a handle to write content data to.
447  * @param index Index of the content to install.
448  */
449 Result AM_InstallContentBegin(Handle *contentHandle, u16 index);
450 
451 /**
452  * @brief Stops installing title content, generally to be resumed later.
453  * @param contentHandle Handle of the installation to abort.
454  */
456 
457 /**
458  * @brief Resumes installing title content.
459  * @param[out] contentHandle Pointer to output a handle to write content data to.
460  * @param[out] resumeOffset Pointer to write the offset to resume content installation at to.
461  * @param index Index of the content to install.
462  */
463 Result AM_InstallContentResume(Handle *contentHandle, u64* resumeOffset, u16 index);
464 
465 /**
466  * @brief Cancels installing title content.
467  * @param contentHandle Handle of the installation to finalize.
468  */
470 
471 /**
472  * @brief Finishes installing title content.
473  * @param contentHandle Handle of the installation to finalize.
474  */
476 
477 /**
478  * @brief Imports up to four certificates into the ticket certificate chain.
479  * @param cert1Size Size of the first certificate.
480  * @param cert1 Data of the first certificate.
481  * @param cert2Size Size of the second certificate.
482  * @param cert2 Data of the second certificate.
483  * @param cert3Size Size of the third certificate.
484  * @param cert3 Data of the third certificate.
485  * @param cert4Size Size of the fourth certificate.
486  * @param cert4 Data of the fourth certificate.
487  */
488 Result AM_ImportCertificates(u32 cert1Size, void* cert1, u32 cert2Size, void* cert2, u32 cert3Size, void* cert3, u32 cert4Size, void* cert4);
489 
490 /**
491  * @brief Imports a certificate into the ticket certificate chain.
492  * @param certSize Size of the certificate.
493  * @param cert Data of the certificate.
494  */
495 Result AM_ImportCertificate(u32 certSize, void* cert);
496 
497 /**
498  * @brief Commits installed titles, and updates FIRM if necessary.
499  * @param mediaType Location of the titles to finalize.
500  * @param titleCount Number of titles to finalize.
501  * @param temp Whether the titles being finalized are in the temporary database.
502  * @param titleIds Title IDs to finalize.
503  */
504 Result AM_CommitImportTitlesAndUpdateFirmwareAuto(FS_MediaType mediaType, u32 titleCount, bool temp, u64* titleIds);
505 
506 /// Resets play count of all installed demos by deleting their launch info.
508 
509 /// Deletes temporary titles.
511 
512 /**
513  * @brief Deletes all expired titles.
514  * @param mediatype Media type to delete from.
515  */
517 
518 /// Deletes all TWL titles.
520 
521 /**
522  * @brief Gets the number of content index installed under the specified DLC title.
523  * @param[out] count Pointer to output the number of content indices to.
524  * @param mediatype Media type of the title.
525  * @param titleID Title ID to retrieve the count for (high-id is 0x0004008C).
526  */
528 
529 /**
530  * @brief Gets content infos installed under the specified DLC title.
531  * @param[out] contentInfoRead Pointer to output the number of content infos read to.
532  * @param mediatype Media type of the title.
533  * @param titleID Title ID to retrieve the content infos for (high-id is 0x0004008C).
534  * @param contentInfoCount Number of content infos to retrieve.
535  * @param offset Offset from the first content index the count starts at.
536  * @param[out] contentInfos Pointer to output the content infos read to.
537  */
538 Result AMAPP_ListDLCContentInfos(u32* contentInfoRead, FS_MediaType mediatype, u64 titleID, u32 contentInfoCount, u32 offset, AM_ContentInfo* contentInfos);
Result amInit(void)
Initializes AM. This doesn't initialize with "am:app", see amAppInit().
Result AM_InstallNativeFirm(void)
Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)
Result AM_InstallFirm(u64 titleID)
Installs a NATIVE_FIRM title to NAND.
Result AM_DeleteTitle(FS_MediaType mediatype, u64 titleID)
Deletes a title.
Result AM_GetCiaCoreVersion(u32 *coreVersion, Handle fileHandle)
Gets the core version of a CIA file.
Result AM_ReadTwlBackupInfo(Handle filehandle, void *outinfo, u32 outinfo_size, void *workbuf, u32 workbuf_size, void *banner, u32 banner_size)
Reads info from the specified DSiWare export file.
Result AM_DeleteAllPendingTitles(FS_MediaType mediatype)
Deletes all pending titles.
Result AM_InstallTmdBegin(Handle *tmdHandle)
Begins installing a TMD.
Result AM_InstallContentFinish(Handle contentHandle)
Finishes installing title content.
Result AM_ImportCertificate(u32 certSize, void *cert)
Imports a certificate into the ticket certificate chain.
Result AM_ExportTwlBackup(u64 titleID, u8 operation, void *workbuf, u32 workbuf_size, const char *filepath)
Exports DSiWare to the specified filepath.
Result AM_GetTitleProductCode(FS_MediaType mediatype, u64 titleId, char *productCode)
Gets the product code of a title.
Result AMAPP_GetDLCContentInfoCount(u32 *count, FS_MediaType mediatype, u64 titleID)
Gets the number of content index installed under the specified DLC title.
Result AM_InstallTicketAbort(Handle ticketHandle)
Aborts installing a ticket.
Result AM_InstallContentCancel(Handle contentHandle)
Cancels installing title content.
Result AM_GetPendingTitleInfo(u32 titleCount, FS_MediaType mediatype, u64 *titleIds, AM_PendingTitleEntry *titleInfo)
Gets information about pending titles on this system.
Result AM_StartCiaInstall(FS_MediaType mediatype, Handle *ciaHandle)
Initializes the CIA install process, returning a handle to write CIA data to.
Result AM_DeleteAllExpiredTitles(FS_MediaType mediatype)
Deletes all expired titles.
Result AM_StartDlpChildCiaInstall(Handle *ciaHandle)
Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.
Result AM_InstallTitleAbort(void)
Aborts installing a title.
Result AM_DeleteAllTwlTitles(void)
Deletes all TWL titles.
Result AM_InitializeExternalTitleDatabase(bool overwrite)
Initializes the external (SD) title database.
Result AM_QueryAvailableExternalTitleDatabase(bool *available)
Queries whether the external title database is available.
Result AM_DeletePendingTitles(FS_MediaType mediatype, u32 flags)
Deletes pending titles.
Result AM_GetTicketCount(u32 *count)
Gets the number of tickets installed on the system.
Result AM_GetDeviceId(u32 *deviceID)
Gets a 32-bit device-specific ID.
Result AM_CancelCIAInstall(Handle ciaHandle)
Aborts the CIA install process.
Result AM_GetTitleCount(FS_MediaType mediatype, u32 *count)
Gets the number of titles for a given media type.
Result AM_DeletePendingTitle(FS_MediaType mediatype, u64 titleId)
Deletes a pending title.
Result AM_InstallContentBegin(Handle *contentHandle, u16 index)
Begins installing title content.
Result AM_GetCiaMetaOffset(u64 *metaOffset, Handle fileHandle)
Gets the meta section offset of a CIA file.
Result AM_InstallTitleBegin(FS_MediaType mediaType, u64 titleId, bool unk)
Begins installing a title.
Result AM_DeleteAllDemoLaunchInfos(void)
Resets play count of all installed demos by deleting their launch info.
Result AM_InstallTmdAbort(Handle tmdHandle)
Aborts installing a TMD.
Result AM_FinishCiaInstallWithoutCommit(Handle ciaHandle)
Finalizes the CIA install process without committing the title to title.db or tmp*....
Result AM_DeleteTicket(u64 ticketId)
Deletes a ticket.
Result AM_GetPendingTitleList(u32 *titlesRead, u32 titleCount, FS_MediaType mediatype, u32 statusMask, u64 *titleIds)
Gets a list of pending titles on this system.
@ AM_STATUS_MASK_INSTALLING
Titles currently installing.
Definition: am.h:21
@ AM_STATUS_MASK_AWAITING_FINALIZATION
Titles awaiting finalization.
Definition: am.h:22
AM_ContentInfoFlags
Title ContentInfo flags.
Definition: am.h:71
@ AM_CONTENT_DOWNLOADED
?
Definition: am.h:72
@ AM_CONTENT_OWNED
?
Definition: am.h:73
Result AM_InstallTicketFinish(Handle ticketHandle)
Finishes installing a ticket.
Result AM_GetTitleList(u32 *titlesRead, FS_MediaType mediatype, u32 titleCount, u64 *titleIds)
Gets a list of title IDs present in a mediatype.
Handle * amGetSessionHandle(void)
Gets the current AM session handle.
void amExit(void)
Exits AM.
Result AM_DeleteAppTitle(FS_MediaType mediatype, u64 titleID)
Deletes a title, provided that it is not a system title.
Result AM_InstallContentStop(Handle contentHandle)
Stops installing title content, generally to be resumed later.
Result AMAPP_ListDLCContentInfos(u32 *contentInfoRead, FS_MediaType mediatype, u64 titleID, u32 contentInfoCount, u32 offset, AM_ContentInfo *contentInfos)
Gets content infos installed under the specified DLC title.
Result AM_InstallTitleStop(void)
Stops installing a title, generally to be resumed later.
Result AM_CommitImportTitlesAndUpdateFirmwareAuto(FS_MediaType mediaType, u32 titleCount, bool temp, u64 *titleIds)
Commits installed titles, and updates FIRM if necessary.
Result AM_CreateImportContentContexts(u32 contentCount, u16 *contentIndices)
Prepares to import title contents.
Result AM_ImportTwlBackup(Handle filehandle, u8 operation, void *buffer, u32 size)
Imports DSiWare from the specified file.
Result AM_ImportCertificates(u32 cert1Size, void *cert1, u32 cert2Size, void *cert2, u32 cert3Size, void *cert3, u32 cert4Size, void *cert4)
Imports up to four certificates into the ticket certificate chain.
Result AM_InstallTmdFinish(Handle tmdHandle, bool unk)
Finishes installing a TMD.
Result AM_CommitImportTitles(FS_MediaType mediaType, u32 titleCount, bool temp, const u64 *titleIds)
Commits installed titles.
Result AM_InstallTitleResume(FS_MediaType mediaType, u64 titleId)
Resumes installing a title.
Result AM_InstallContentResume(Handle *contentHandle, u64 *resumeOffset, u16 index)
Resumes installing title content.
Result AM_GetPendingTitleCount(u32 *count, FS_MediaType mediatype, u32 statusMask)
Gets the number of pending titles on this system.
Result AM_GetTicketList(u32 *ticketsRead, u32 ticketCount, u32 skip, u64 *ticketIds)
Gets a list of tickets installed on the system.
Result amAppInit(void)
Initializes AM with a service which has access to the amapp-commands. This should only be used when u...
Result AM_GetCiaIcon(void *icon, Handle fileHandle)
Gets the SMDH icon data of a CIA file.
AM_InstallStatus
Pending title status values.
Definition: am.h:27
@ AM_STATUS_AWAITING_FINALIZATION
Awaiting finalization.
Definition: am.h:31
@ AM_STATUS_SAVED
Title saved, but not installed.
Definition: am.h:29
@ AM_STATUS_ABORTED
Install aborted.
Definition: am.h:28
@ AM_STATUS_INSTALL_IN_PROGRESS
Install in progress.
Definition: am.h:30
Result AM_GetCiaDependencies(u64 *dependencies, Handle fileHandle)
Gets the title ID dependency list of a CIA file.
Result AM_GetCiaFileInfo(FS_MediaType mediatype, AM_TitleEntry *titleEntry, Handle fileHandle)
Gets an AM_TitleEntry instance for a CIA file.
Result AM_CommitImportPrograms(FS_MediaType mediaType, u32 titleCount, bool temp, const u64 *titleIds)
Commits installed CIAs.
Result AM_GetCiaRequiredSpace(u64 *requiredSpace, FS_MediaType mediaType, Handle fileHandle)
Gets the free space, in bytes, required to install a CIA file.
Result AM_DeleteAllTemporaryTitles(void)
Deletes temporary titles.
Result AM_GetTitleInfo(FS_MediaType mediatype, u32 titleCount, u64 *titleIds, AM_TitleEntry *titleInfo)
Gets a list of details about installed titles.
Result AM_GetCiaMetaSection(void *meta, u32 size, Handle fileHandle)
Gets the full meta section of a CIA file.
Result AM_GetTitleExtDataId(u64 *extDataId, FS_MediaType mediatype, u64 titleId)
Gets the ext data ID of a title.
Result AM_GetTWLPartitionInfo(AM_TWLPartitionInfo *info)
Retrieves information about the NAND TWL partition.
Result AM_InstallTicketBegin(Handle *ticketHandle)
Begins installing a ticket.
@ AM_DELETE_PENDING_SYSTEM
System titles.
Definition: am.h:48
@ AM_DELETE_PENDING_NON_SYSTEM
Non-system titles.
Definition: am.h:47
Result AM_InstallTitleFinish(void)
Finishes installing a title.
Result AM_FinishCiaInstall(Handle ciaHandle)
Finalizes the CIA install process.
Filesystem Services.
FS_MediaType
Media types.
Definition: fs.h:35
Contains information about a title's content.
Definition: am.h:60
u16 type
?
Definition: am.h:62
u16 index
Index of the content in the title.
Definition: am.h:61
u8 flags
AM_ContentInfoFlags
Definition: am.h:65
u32 contentId
ID of the content in the title.
Definition: am.h:63
u64 size
Size of the content in the title.
Definition: am.h:64
Definition: am.h:36
u16 status
AM_InstallStatus
Definition: am.h:39
u64 titleId
Title ID.
Definition: am.h:37
u16 version
Version.
Definition: am.h:38
u32 titleType
Title Type.
Definition: am.h:40
Information about the TWL NAND partition.
Definition: am.h:52
u64 freeSpace
Total free space.
Definition: am.h:54
u64 titlesCapacity
Capacity for titles.
Definition: am.h:55
u64 capacity
Total capacity.
Definition: am.h:53
u64 titlesFreeSpace
Free space for titles.
Definition: am.h:56
Contains basic information about a title.
Definition: am.h:11
u64 titleID
The title's ID.
Definition: am.h:12
u16 version
The title's version.
Definition: am.h:14
u64 size
The title's installed size.
Definition: am.h:13
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:47
uint64_t u64
64-bit unsigned integer
Definition: types.h:24
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
u32 Handle
Resource handle.
Definition: types.h:41
s32 Result
Function result.
Definition: types.h:42
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
uint32_t u32
32-bit unsigned integer
Definition: types.h:23