From f65ae3057456871b88aeccc9b4d9ff6e61c33df6 Mon Sep 17 00:00:00 2001 From: fangrong Date: Fri, 19 Sep 2025 18:15:20 +0800 Subject: [PATCH] ns: Add appmemtype parameter to NS_RebootToTitle --- libctru/include/3ds/services/ns.h | 3 ++- libctru/source/services/ns.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libctru/include/3ds/services/ns.h b/libctru/include/3ds/services/ns.h index 1a40bf0a5..92f176dec 100644 --- a/libctru/include/3ds/services/ns.h +++ b/libctru/include/3ds/services/ns.h @@ -37,8 +37,9 @@ Result NS_LaunchApplicationFIRM(u64 titleid, u32 flags); * @brief Reboots to a title. * @param mediatype Mediatype of the title. * @param titleid ID of the title to launch. + * @param appmemtype The memory type a title should be launched under. */ -Result NS_RebootToTitle(u8 mediatype, u64 titleid); +Result NS_RebootToTitle(u8 mediatype, u64 titleid, u8 appmemtype); /** * @brief Terminates the process with the specified titleid. diff --git a/libctru/source/services/ns.c b/libctru/source/services/ns.c index 2a0c25229..cdef1d03c 100644 --- a/libctru/source/services/ns.c +++ b/libctru/source/services/ns.c @@ -83,7 +83,7 @@ Result NS_LaunchApplicationFIRM(u64 titleid, u32 flags) return (Result)cmdbuf[1]; } -Result NS_RebootToTitle(u8 mediatype, u64 titleid) +Result NS_RebootToTitle(u8 mediatype, u64 titleid, u8 appmemtype) { Result ret = 0; u32 *cmdbuf = getThreadCommandBuffer(); @@ -94,7 +94,7 @@ Result NS_RebootToTitle(u8 mediatype, u64 titleid) cmdbuf[3] = (titleid >> 32) & 0xffffffff; cmdbuf[4] = mediatype; cmdbuf[5] = 0x0; // reserved - cmdbuf[6] = 0x0; + cmdbuf[6] = appmemtype; if(R_FAILED(ret = svcSendSyncRequest(nsHandle)))return ret;