]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added ampxiInstallTitlesFinish.
authoryellows8 <yellows8@users.noreply.github.com>
Tue, 26 Jan 2016 06:09:21 +0000 (01:09 -0500)
committeryellows8 <yellows8@users.noreply.github.com>
Tue, 26 Jan 2016 06:09:21 +0000 (01:09 -0500)
libctru/include/3ds/services/ampxi.h
libctru/source/services/ampxi.c

index 43f87410e672d6b0d2d3f7bea0f136d139999568..03b6b18999d7ce33686931b021a1545d89ebc4d7 100644 (file)
@@ -23,3 +23,13 @@ void ampxiExit(void);
  * @param operation https://3dbrew.org/wiki/AM:ImportDSiWare
  */
 Result ampxiWriteTWLSavedata(u64 titleid, u8 *buffer, u32 size, u32 image_filepos, u8 section_type, u8 operation);
+
+/**
+ * @brief Finalizes title installation. https://3dbrew.org/wiki/AMPXI:InstallTitlesFinish
+ * @param mediaType Mediatype of the titles to finalize.
+ * @param db Which title database to use.
+ * @param size Size of the savedata buffer.
+ * @param titlecount Total titles.
+ * @param tidlist List of titleIDs.
+ */
+Result ampxiInstallTitlesFinish(FS_MediaType mediaType, u8 db, u32 titlecount, u64 *tidlist);
index 546575556ad91dff9bcffb6c45bd111f27c555ee..9af78f8058bbe9ec55bdf7df68200cfcdf234f14 100644 (file)
@@ -4,6 +4,7 @@
 #include <3ds/svc.h>
 #include <3ds/srv.h>
 #include <3ds/synchronization.h>
+#include <3ds/services/fs.h>
 #include <3ds/services/ampxi.h>
 #include <3ds/ipc.h>
 
@@ -52,3 +53,22 @@ Result ampxiWriteTWLSavedata(u64 titleid, u8 *buffer, u32 size, u32 image_filepo
 
        return (Result)cmdbuf[1];
 }
+
+Result ampxiInstallTitlesFinish(FS_MediaType mediaType, u8 db, u32 titlecount, u64 *tidlist)
+{
+       Result ret = 0;
+       u32 *cmdbuf = getThreadCommandBuffer();
+
+       cmdbuf[0] = IPC_MakeHeader(0x2A,3,2); // 0x2A00C2
+       cmdbuf[1] = mediaType;
+       cmdbuf[2] = titlecount;
+       cmdbuf[3] = db;
+
+       cmdbuf[4] = IPC_Desc_PXIBuffer(titlecount*8, 0, 0);
+       cmdbuf[5] = (u32)tidlist;
+
+       if(R_FAILED(ret = svcSendSyncRequest(ampxiHandle)))return ret;
+
+       return (Result)cmdbuf[1];
+}
+