From 99a5c4406b8d70dba3899f5de6d2fb1fa12d77c6 Mon Sep 17 00:00:00 2001 From: smea Date: Wed, 19 Nov 2014 17:25:40 -0800 Subject: [PATCH] added APT_HardwareResetAsync (tested) --- libctru/include/3ds/services/apt.h | 1 + libctru/source/services/apt.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/libctru/include/3ds/services/apt.h b/libctru/include/3ds/services/apt.h index ad94d01..af8fd5b 100644 --- a/libctru/include/3ds/services/apt.h +++ b/libctru/include/3ds/services/apt.h @@ -53,6 +53,7 @@ bool aptMainLoop(); // Use like this in your main(): while (aptMainLoop()) { you Result APT_GetLockHandle(Handle* handle, u16 flags, Handle* lockHandle); Result APT_Initialize(Handle* handle, NS_APPID appId, Handle* eventHandle1, Handle* eventHandle2); +Result APT_HardwareResetAsync(Handle* handle); Result APT_Enable(Handle* handle, u32 a); Result APT_GetAppletManInfo(Handle* handle, u8 inval, u8 *outval8, u32 *outval32, NS_APPID *menu_appid, NS_APPID *active_appid); Result APT_PrepareToJumpToHomeMenu(Handle* handle); diff --git a/libctru/source/services/apt.c b/libctru/source/services/apt.c index 4f417fa..ba8e131 100644 --- a/libctru/source/services/apt.c +++ b/libctru/source/services/apt.c @@ -553,6 +553,18 @@ Result APT_Initialize(Handle* handle, NS_APPID appId, Handle* eventHandle1, Hand return cmdbuf[1]; } +Result APT_HardwareResetAsync(Handle* handle) +{ + if(!handle)handle=&aptuHandle; + u32* cmdbuf=getThreadCommandBuffer(); + cmdbuf[0]=0x4E0000; //request header code + + Result ret=0; + if((ret=svcSendSyncRequest(*handle)))return ret; + + return cmdbuf[1]; +} + Result APT_Enable(Handle* handle, u32 a) { if(!handle)handle=&aptuHandle;