Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add applet locking and main loop polling #261

Open
wants to merge 1 commit into
base: rewrite
Choose a base branch
from

Conversation

ITotalJustice
Copy link

as explained in the gbatemp post.


appletLockExit() prevents the app from being closed via the home menu until either 15s has elapsed, or appletUnlockExit() is called.

appletMainLoop() will return false once the applet is being requested to exit, ie closing via the home menu.

so for example, a user attempts to close jksv via the home screen (or presses the home button whilst in applet mode), due to appletLockExit(), this prevents it from being killed immediately. appletMainLoop() will now return false, and so your main loop exits. after main returns, the function userAppExit() is called which in turn calls appletUnlockExit(), the app now closes.

this allows for all resources / files to be properly cleaned up, and any mid-transfer stuff to be handled as needed. there is a 15s window to do everything, which is plenty of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant