3DS halts after sleeping while running homebrew

Post Reply
darkweb
Posts: 2
Joined: Mon Mar 09, 2020 4:26 pm

3DS halts after sleeping while running homebrew

Post by darkweb » Fri May 01, 2020 6:29 pm

Hi all,
I've got an SDL game that I've ported over to the 3DS and I'm having an issue where the entire 3DS seems to lock up after you close the lid and open it again. I've tried accessing Luma but that doesn't seem to come up at all after closing the lid either and I have to do a hard shutdown. I've tested other homebrew such as OpenTyrian and that doesn't seem to have a problem.
I've also tried using gdb but as soon as I close the lid it terminates the connection.

If you'd like to take a look at the code you can see it here: https://github.com/pyroticinsanity/3dsdod

I'm out of ideas so any help would be greatly appreciated!

darkweb
Posts: 2
Joined: Mon Mar 09, 2020 4:26 pm

Re: 3DS halts after sleeping while running homebrew

Post by darkweb » Tue May 26, 2020 10:25 pm

It turned out that it's not enough to just call aptMainLoop. If you call it in a tight loop without any graphical code you need to give up the CPU as well. The fix for me was to call svcSleepThread(1) in my code as well and that was enough to give resources to the 3DS to properly manage the home button.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests