Refactor OrbisFiber to match PS4 layout and obfuscation#3955
Open
w1naenator wants to merge 16 commits intoshadps4-emu:mainfrom
Open
Refactor OrbisFiber to match PS4 layout and obfuscation#3955w1naenator wants to merge 16 commits intoshadps4-emu:mainfrom
w1naenator wants to merge 16 commits intoshadps4-emu:mainfrom
Conversation
Contributor
w1naenator
commented
Jan 24, 2026
- Redesign OrbisFiber struct to match PS4's internal layout, including new fields, padding, and explicit size/alignment checks.
- Store entry, arg_on_initialize, and name in obfuscated (XORed) form; add helper functions for encoding/decoding.
- Replace plain name string with XORed byte array and per-fiber randomization.
- Add random_pad field, filled with pseudo-random data on init.
- Use atomic helpers for fiber state transitions instead of direct atomic access.
- Update all code to use new accessors for obfuscated fields.
- Improve stack overflow and context size margin checks.
- Zero-initialize OrbisFiberOptParam in its initializer.
- Add and includes for new memory operations.
- Miscellaneous bug fixes and code cleanup.
- Redesign OrbisFiber struct to match PS4's internal layout, including new fields, padding, and explicit size/alignment checks. - Store entry, arg_on_initialize, and name in obfuscated (XORed) form; add helper functions for encoding/decoding. - Replace plain name string with XORed byte array and per-fiber randomization. - Add random_pad field, filled with pseudo-random data on init. - Use atomic helpers for fiber state transitions instead of direct atomic access. - Update all code to use new accessors for obfuscated fields. - Improve stack overflow and context size margin checks. - Zero-initialize OrbisFiberOptParam in its initializer. - Add <cstring> and <cstddef> includes for new memory operations. - Miscellaneous bug fixes and code cleanup.
Contributor
Author
|
This fixes the emulator crashing in Gravity Rush 2 on Windows, which I used to test the font library. Together with the fontlib branch in HLE mode, the font is now visible. I am not sure whether this is usable in the project, but you can test it. |
squidbus
reviewed
Jan 24, 2026
added 3 commits
January 26, 2026 03:40
- Added Ulobjmgr support in logging and fiber management, including new functions for registration and unregistration. - Updated fiber context structure to include ASan (AddressSanitizer) support and improved stack handling. - Enhanced fiber switching logic to accommodate ASan and Razor CPU features. - Introduced logging for Ulobjmgr function calls to aid in debugging. - Modified memory and pthread headers to include necessary function declarations for ASan and thread management. - Improved error handling and logging throughout the fiber management code.
Contributor
Author
|
Actually, after rewriting the fiber library, I found that the TLS hygiene (ClearStack<12_KB>()) causes a stack overflow on Windows in the fiber library. Please check this; I think the structs should better match the ABI. |
…t compile options for Apple
|
No changes in my titles. |
This comment was marked as abuse.
This comment was marked as abuse.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.