diff --git a/libctru/include/3ds/services/boss.h b/libctru/include/3ds/services/boss.h index 3b9c68e..6d65906 100644 --- a/libctru/include/3ds/services/boss.h +++ b/libctru/include/3ds/services/boss.h @@ -57,6 +57,14 @@ void bossExit(void); /// Returns the BOSS session handle. Handle bossGetSessionHandle(void); +/** + * @brief Set the content data storage location. + * @param extdataID u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND. + * @param boss_size Probably the max size in the extdata which BOSS can use. + * @param mediaType Roughly the same as FS mediatype. + */ +Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType); + /** * @brief Register a task. * @param taskID BOSS taskID. diff --git a/libctru/source/services/boss.c b/libctru/source/services/boss.c index f7dc6c0..cc1631d 100644 --- a/libctru/source/services/boss.c +++ b/libctru/source/services/boss.c @@ -81,6 +81,22 @@ static Result bossipc_InitializeSession(u64 programID) return (Result)cmdbuf[1]; } +Result bossSetStorageInfo(u64 extdataID, u32 boss_size, u8 mediaType) +{ + Result ret = 0; + u32 *cmdbuf = getThreadCommandBuffer(); + + cmdbuf[0] = IPC_MakeHeader(0x2,4,0); // 0x20100 + cmdbuf[1] = (u32) extdataID; + cmdbuf[2] = (u32) (extdataID >> 32); + cmdbuf[3] = boss_size; + cmdbuf[4] = mediaType; + + if(R_FAILED(ret = svcSendSyncRequest(bossHandle)))return ret; + + return (Result)cmdbuf[1]; +} + Result bossRegisterTask(const char *taskID, u8 unk0, u8 unk1) { Result ret = 0;