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 an exit request hook type, allow to delay exit #183

Merged
merged 2 commits into from Oct 9, 2018

Conversation

p-sam
Copy link
Contributor

@p-sam p-sam commented Oct 9, 2018

This will permit to be able to be notified on exit by:

  • hooking on exit
  • being able to delay exit until decided

Here is an example of use: https://gist.github.com/p-sam/bd39c9a084cfd45c793d0bdfe2b8f2c7

Homebrew would be able to use this moment to flush state, and close handles. (eg: RetroArch flushing SaveRAM)

@@ -1211,6 +1209,10 @@ bool appletMainLoop(void) {
}

switch(msg) {
case 0x4:
appletCallHook(AppletHookType_OnExitRequest);
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add: return false; here. Apps won't need to use appletHook with this, just use appletUnlockExit after main-loop exit. Apps should not exit without calling appletUnlockExit if appletLockExit was used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update your gist for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, that makes that use-case much simpler, I also updated the gist to reflect change

@yellows8
Copy link
Contributor

yellows8 commented Oct 9, 2018

Can you doc the lock/unlock cmds on switchbrew? https://switchbrew.org/wiki/AM_services#LockExit

@yellows8 yellows8 merged commit 74ebf37 into switchbrew:master Oct 9, 2018
@p-sam
Copy link
Contributor Author

p-sam commented Oct 9, 2018

Can you doc the lock/unlock cmds on switchbrew? https://switchbrew.org/wiki/AM_services#LockExit

sure, will do i a bit

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.

None yet

2 participants