Repository navigation
Corrected scratchpad usage - #393
Merged
Merged
Conversation
This thread attribute has been illegal on PSP firmware 1.00, 1.50 and 6.60 as proven by disassembly. It's never worked and simply never been documented. Scratchpad can be written to manually, but threads created with `PSP_THREAD_ATTR_SCRATCH_SRAM` have never succeeded.
sharkwouter
approved these changes
Sep 23, 2026
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.
PSPSDK currently includes
PSP_THREAD_ATTR_SCRATCH_SRAMas a Threadman attribute. Disassembly confirms that this has never been a real attribute (in 1.00, 1.50, and 6.60).It turns out this being in PSPSDK was probably an error in the first place. The earliest ps2dev thread to use this attribute mentions that it didn't work at the time, and should probably be commented out; it was added anyway. Another thread from 2009 runs into the same problem, so this was probably always broken. You can try this for yourself - a thread with this will always return
SCE_KERNEL_ERROR_ILLEGAL_ATTR.You can still write to scratchpad directly from
0x00010000through0x00013fff. At the moment we have no samples demonstrating its usage and very few homebrews are aware of it. This initial commit is just a correctness fix removing the bad attr.I'm opening the floor here because I think we could benefit from documentation and a sample for SRAM going forward, and I'd like to know if anyone has any experience with it. Hopefully this can at least kickstart the discussion.