Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joel16/1ad12cc6a05056fd815b6ffae1f544ca to your computer and use it in GitHub Desktop.
Save joel16/1ad12cc6a05056fd815b6ffae1f544ca to your computer and use it in GitHub Desktop.
Result AM_GetStorageId(u64 *storageId, FS_MediaType mediatype, u64 titleId)
{
Result ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = IPC_MakeHeader(0x6,3,0); // 0x000600C0
cmdbuf[1] = mediatype;
cmdbuf[2] = titleId & 0xffffffff;
cmdbuf[3] = (u32)(titleId >> 32);
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
if(storageId) *storageId = (u64)cmdbuf[2] | ((u64)cmdbuf[3] << 32);
return (Result)cmdbuf[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment