GSPGPU_ImportDisplayCaptureInfo(NULL, &gspcapinfo);
// Fill in display-capture info for NS.
- if(gspcapinfo.screencapture[0].framebuf0_vaddr != gspcapinfo.screencapture[1].framebuf0_vaddr)ns_capinfo[1] = 1;
+ if(gspcapinfo.screencapture[0].framebuf0_vaddr != gspcapinfo.screencapture[0].framebuf1_vaddr)ns_capinfo[1] = 1;
ns_capinfo[4] = gspcapinfo.screencapture[0].format & 0x7;
ns_capinfo[7] = gspcapinfo.screencapture[1].format & 0x7;
svcClearEvent(aptStatusEvent);
aptSetStatus(APP_RUNNING);
+ svcClearEvent(aptStatusEvent);
}
static void __handle_notification() {
break;
case APP_APPLETCLOSED:
aptAppletClosed();
+ aptCallHook(APTHOOK_ONRESTORE);
break;
case APP_PREPARE_SLEEPMODE:
aptCallHook(APTHOOK_ONSLEEP);
return 0;
}
+ // This may be needed in future exploits because APT_CheckNew3DS has a
+ // compatibility mode which always return zero even on an actual N3DS.
+ if (__system_runflags & BIT(31))
+ {
+ __apt_new3dsflag_initialized = 1;
+ __apt_new3dsflag = 1;
+ *out = 1;
+ return 0;
+ }
+
aptOpenSession();
if(currentAppId==APPID_APPLICATION)
{
if(tmp!=0)break;
}
+ aptCallHook(APTHOOK_ONSUSPEND);
+
+ __apt_launchapplet_appID = appID;
+ __apt_launchapplet_inhandle = inhandle;
+ __apt_launchapplet_parambuf = parambuf;
+ __apt_launchapplet_parambufsize = parambufsize;
+
// Set status to SUSPENDED.
svcClearEvent(aptStatusEvent);
aptSetStatus(APP_SUSPENDED);
// Release GSP module.
GSPGPU_ReleaseRight(NULL);
- __apt_launchapplet_appID = appID;
- __apt_launchapplet_inhandle = inhandle;
- __apt_launchapplet_parambuf = parambuf;
- __apt_launchapplet_parambufsize = parambufsize;
-
return 0;
}