Commit Graph

88 Commits

Author SHA1 Message Date
fincs
de18776fac Clean up and simplify APT_CheckNew3DS 2015-06-20 18:17:44 +02:00
fincs
7706270720 Some minor APT fixes (capture typo, race condition fix, etc) 2015-06-20 17:06:32 +02:00
yellows8
0ec23dc90a In APT_CheckNew3DS_*, properly load+check the retval from the cmdbuf when svcSendSyncRequest was successful. In APT_CheckNew3DS(), added code to check for out nullptr, and code to clear out. 2015-05-29 17:15:55 -04:00
fincs
8ac3549abf Fix APT applet launch code [regression caused by c75ed65] 2015-05-23 18:46:56 +02:00
fincs
da680e0503 Add APT event hooking mechanism 2015-05-22 21:56:47 +02:00
fincs
e2b1da4d80 Minor APT behaviour change 2015-05-13 14:10:25 +02:00
fincs
350cb955b2 Added RUNFLAG_APTREINIT for supporting environments that require APT reinitialization 2015-05-06 22:01:40 +02:00
profi200
1a6bdc38a9 Implemented functions to start system applets. 2015-03-07 22:10:18 +01:00
Dave Murphy
dc7ef6fd28 correct aptEventHandler signature 2015-02-11 22:15:13 +00:00
smea
800cb7b566 Update apt.c 2014-12-26 12:51:01 -08:00
Dave Murphy
78b94b4eea auto initialise commonly used services, prevent double initialisation 2014-12-25 23:27:36 +00:00
Dave Murphy
c76ea75ae2 stop building everything when any header changes 2014-12-13 16:36:54 +00:00
StapleButter
c75ed65d8b Fix HOME button shiz.
(apparently APP_APPLETSTARTED happens when pressing the HOME button and causes aptWaitStatusEvent() to end prematurely)
2014-11-29 21:04:03 +01:00
StapleButter
32f8e69b96 Sleep mode fixes. 2014-11-29 19:39:00 +01:00
yellows8
8dbe9d9128 Added more code to aptAppletUtility_Exit_RetToApp() for when a library applet is closing, but this still doesn't fix the broken applet process termination. 2014-11-28 02:12:49 -05:00
yellows8
7281abfcd7 Added code for APT_IsRegistered. Added code for launching library applets, which isn't usable from the homebrew launcher atm. 2014-11-21 00:35:37 -05:00
smea
99a5c4406b added APT_HardwareResetAsync (tested) 2014-11-19 17:25:40 -08:00
yellows8
c60bdb3670 With RUNFLAG_APTWORKAROUND enabled, at the start of aptReturnToMenu just set the status to APP_EXITING then return(this func won't actually get executed with RUNFLAG_APTWORKAROUND atm). Updated __handle_notification() to check for errors from APT_InquireNotification. In aptExit only call the applet-utility code when RUNFLAG_APTWORKAROUND is not set. Minor other changes. Fixed APT_CheckNew3DS code so that it properly only uses one of the APT cmds. 2014-11-18 23:48:50 -05:00
profi200
16ce5f4c7b Added functions for launching other apps/applets 2014-11-10 17:03:41 +01:00
fincs
e460e6a673 aptMainLoop(): Add handling for APP_PREPARE_SLEEPMODE 2014-11-05 00:24:24 +01:00
fincs
e4aeaba747 Attempt to fix APT hang during startup due to bad event handling 2014-11-04 21:41:31 +01:00
fincs
7f10ad4097 Add aptMainLoop() for handling APT events in main() 2014-11-02 18:58:37 +01:00
yellows8
3135d1c344 Updated APT_CheckNew3DS to only use the APT cmds once(which also now calls aptOpenSession/aptCloseSession), then store the output value in a flag which is then used for all future APT_CheckNew3DS calls. Updated HID init/shutdown code to automatically call irrst init/shutdown code when running on new3ds. Updated irrst init code to only do init when it wasn't already initialized, likewise for the irrst shutdown code. 2014-11-01 23:48:35 -04:00
yellows8
4e90fbb905 Updated CheckNew3DS code. Now the out value is cleared first, then the out value is only set to the cmdreply data when ret is zero. 2014-11-01 22:11:19 -04:00
yellows8
c8795b1b79 Added APT CheckNew3DS code. Added code for attempting to use the other APT services when APT:U isn't accessible. 2014-11-01 21:39:18 -04:00
smea
58a1f0c68e plugged a bunch of handle leaks ! 2014-10-29 21:26:58 -07:00
fincs
76d55fc97a Fix APT initialization code when RUNFLAG_APTWORKAROUND is set 2014-10-27 17:30:55 +01:00
StapleButter
afd2140cb7 Create APT event handler thread as soon as possible, and complete initialization automatically when needed. No more 'call aptSetupEventHandler() as late as possible' shit.
Adapt examples to the changes (not tested).
2014-10-27 15:37:30 +01:00
StapleButter
1f413a7d44 Add synchronization mechanism for entering sleep mode.
When the APT status is APP_PREPARE_SLEEPMODE, the application main thread should call aptSignalReadyForSleep() to signal that it is ready to enter sleep mode, and then call aptWaitStatusEvent() as usual.

Example code:

APP_STATUS status;
while ((status = aptGetStatus()) != APP_EXITING)
{
	if(status==APP_RUNNING)
	{
		// application logic here
	}
	else if(status == APP_SUSPENDING)
	{
		aptReturnToMenu();
	}
	else if(status == APP_PREPARE_SLEEPMODE)
	{
		aptSignalReadyForSleep();
		aptWaitStatusEvent();
	}
}

This maybe isn't the proper/recommended way to do sleep mode, but I tested it multiple times and it always worked reliably.

(note: maybe the sample code above will not work if GPU drawing is done in a separate thread, haven't tested that)
2014-09-18 22:09:15 +02:00
profi200
3d34e123ee Added functions for sysCore usage 2014-09-01 15:49:32 +02:00
fincs
9b370c7eff Reorganize includes 2014-08-26 23:18:14 +02:00
smea
14312cf851 APT WORKAROUND fix 2014-08-24 23:36:37 -07:00
smea
4c9abef1a9 APT WORKAROUND (update 3dsx_crt0.s to https://gist.github.com/smealum/305802b2b9bf4c877ddb and recompile everything please) 2014-08-24 23:25:54 -07:00
plutoo
6f57364680 apt: Trying to make code more managable. 2014-08-24 22:22:28 +02:00
plutoo
ef1323a3a1 APT: Enumerated the notification signals. 2014-08-21 20:54:23 +02:00
smea
4e3c18863b various fixes 2014-08-16 14:48:05 -07:00
plutoo
d35233fb1c Revamped "srv.c". 2014-07-28 23:26:13 +02:00
plutoo
314d53a922 Moved service source-files into source/services/. 2014-07-28 22:04:31 +02:00