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

3DS: Set stack size w/o running ScummVM inside a thread #3432

Merged
merged 1 commit into from Nov 1, 2021

Conversation

@BallM4788
Copy link
Contributor

@BallM4788 BallM4788 commented Oct 21, 2021

Currently, the 3DS port's stack size is set by running ScummVM within a thread, a behavior introduced in fb39b94. Changing the stack size is necessary because libctru's default stack size of 32KiB is not large enough for ScummVM.

This commit introduces a simpler method for changing the stack size. By setting a global variable __stacksize__, we can override the identically-named, weak-attributed __stacksize__ defined in libctru. This is an intentional feature, and renders it unnecessary to run ScummVM within a thread.

Explanation: https://gbatemp.net/threads/homebrew-development.360646/post-6362424
Usage in the wild: https://github.com/masterfeizz/ioQuake3DS/blob/master/code/ctr/ctr_main.c#L44

@BallM4788 BallM4788 changed the title 3DS: Change stack size without creating a new thread 3DS: Set stack size w/o running ScummVM inside a thread Oct 25, 2021
This commit introduces a simpler method for setting the stack size. By setting a global variable __stacksize__,
we can override the identically-named, weak-attributed __stacksize__ defined in libctru. This is an intentional
feature of libctru, and renders it unnecessary to run ScummVM from within a thread.

Source: devkitPro/libctru@192b88b
Explanation: https://gbatemp.net/threads/homebrew-development.360646/page-245#post-6362424
Usage in the wild: https://github.com/masterfeizz/ioQuake3DS/blob/master/code/ctr/ctr_main.c#L44
@sev-
Copy link
Member

@sev- sev- commented Nov 1, 2021

Thank you!

Loading

@sev- sev- merged commit d3e9cdb into scummvm:master Nov 1, 2021
8 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants