More AM_Delete functions (#375)

This commit is contained in:
Joel 2017-09-23 10:42:37 -05:00 committed by fincs
parent d6a628b7d3
commit 04bde1de19
2 changed files with 49 additions and 0 deletions

View File

@ -488,3 +488,15 @@ Result AM_CommitImportTitlesAndUpdateFirmwareAuto(FS_MediaType mediaType, u32 ti
/// Resets play count of all installed demos by deleting their launch info.
Result AM_DeleteAllDemoLaunchInfos(void);
/// Deletes temporary titles.
Result AM_DeleteAllTemporaryTitles(void);
/**
* @brief Deletes all expired titles.
* @param mediatype Media type to delete from.
*/
Result AM_DeleteAllExpiredTitles(FS_MediaType mediatype);
/// Deletes all TWL titles.
Result AM_DeleteAllTwlTitles(void);

View File

@ -994,3 +994,40 @@ Result AM_DeleteAllDemoLaunchInfos(void)
return (Result)cmdbuf[1];
}
Result AM_DeleteAllTemporaryTitles(void)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x16,0,0); // 0x160000
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
return (Result)cmdbuf[1];
}
Result AM_DeleteAllExpiredTitles(FS_MediaType mediatype)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x1F,1,0); // 0x1F0040
cmdbuf[1] = mediatype;
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
return (Result)cmdbuf[1];
}
Result AM_DeleteAllTwlTitles(void)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x1D,0,0); // 0x1D0000
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
return (Result)cmdbuf[1];
}