Skip to content

Corrected scratchpad usage - #393

Merged
sharkwouter merged 1 commit into
pspdev:masterfrom
TheMrIron2:master
Sep 23, 2026
Merged

sharkwouter merged 1 commit into
pspdev:masterfrom
TheMrIron2:master

Conversation

@TheMrIron2

Copy link
Copy Markdown
Contributor

PSPSDK currently includes PSP_THREAD_ATTR_SCRATCH_SRAM as 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 0x00010000 through 0x00013fff. 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.

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
sharkwouter merged commit c1d856c into pspdev:master Sep 23, 2026
1 check passed
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.

2 participants