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