From: profi200 Date: Sun, 1 Mar 2015 20:52:19 +0000 (+0100) Subject: Fixed AM_InstallFIRM(). See 3dbrew. X-Git-Tag: v0.5.0~10^2 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=ed3045ab6a425df79f0b1d7a973e39816dbcaf63;p=corbenik%2Fctrulib.git Fixed AM_InstallFIRM(). See 3dbrew. --- diff --git a/libctru/include/3ds/services/am.h b/libctru/include/3ds/services/am.h index b1d5db2..3eb1501 100644 --- a/libctru/include/3ds/services/am.h +++ b/libctru/include/3ds/services/am.h @@ -107,10 +107,9 @@ Result AM_DeleteAppTitle(u8 mediatype, u64 titleID); About: Installs FIRM to NAND (firm0:/ & firm1:/) from a CXI Note: The title must have the uniqueid: 0x00000, otherwise this will fail. - mediatype mediatype of title titleid title id of title */ -Result AM_InstallFIRM(u8 mediatype, u64 titleID); +Result AM_InstallFIRM(u64 titleID); /* AM_GetTitleProductCode() About: Gets the product code of a title based on its title id. diff --git a/libctru/source/services/am.c b/libctru/source/services/am.c index e6c84a8..e80faff 100644 --- a/libctru/source/services/am.c +++ b/libctru/source/services/am.c @@ -171,15 +171,14 @@ Result AM_DeleteAppTitle(u8 mediatype, u64 titleID) return (Result)cmdbuf[1]; } -Result AM_InstallFIRM(u8 mediatype, u64 titleID) +Result AM_InstallFIRM(u64 titleID) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); - cmdbuf[0] = 0x000400C0; - cmdbuf[1] = mediatype; - cmdbuf[2] = titleID & 0xffffffff; - cmdbuf[3] = (u32)(titleID >> 32); + cmdbuf[0] = 0x04010080; + cmdbuf[1] = titleID & 0xffffffff; + cmdbuf[2] = (u32)(titleID >> 32); if((ret = svcSendSyncRequest(amHandle))!=0) return ret;