A Modern Rust SDK for Sony PSP Homebrew Development
Edition 2024 · Safety Hardened · Kernel Mode Support
Everything you need to write modern, safe homebrew for the PSP.
829 bindings across 33 modules covering every PSP subsystem — graphics, audio, networking, I/O, threading, and more.
33 high-level modules with RAII resource management, Result types, and zero panics in allocators or VRAM code.
Privileged APIs for NAND flash, IR remote, ME coprocessor, syscall hooking, and hardware register I/O.
cargo-psp wraps the entire pipeline: Rust source to ELF to PRX to EBOOT.PBP with a single command.
Use String, Vec, HashMap, and the full Rust standard library on PSP for familiar, productive development.
Automated integration tests run in PPSSPPHeadless via Docker, ensuring code works on real PSP hardware.
Get from zero to running PSP homebrew in minutes.
You'll need Rust nightly and the source component for cross-compilation.
bash rustup default nightly rustup component add rust-src
Download a prebuilt binary from Releases, or build from source.
bash # From crates.io (or GitHub Releases for prebuilt binaries) cargo install cargo-psp
Set up a new Cargo project and write your first PSP module.
bash cargo new hello-psp && cd hello-psp
Add psp to your Cargo.toml, then write your entry point:
rust #![no_std] #![no_main] use psp; psp::module!("hello_psp", 1, 1); fn psp_main() { psp::dprintln!("Hello from the PSP!"); }
Build your project into an EBOOT.PBP that the PSP can run.
bash cargo +nightly psp --release # Output: target/mipsel-sony-psp/release/EBOOT.PBP
Copy the EBOOT.PBP to your PSP's ms0:/PSP/GAME/hello_psp/ folder, or open it in PPSSPP.
33 high-level modules organized by domain. Click a category to explore.
30 working examples covering graphics, audio, networking, input, and more.
Generates and plays a 440Hz sine wave tone for 3 seconds using the PSP audio subsystem.
View Source →Saves and loads key-value configuration settings with multiple data types to binary RCFG format.
View Source →Renders a rotating 3D textured cube using the GU graphics engine with matrix transforms and depth testing.
View Source →Draws shapes and text using the embedded-graphics library including triangles, rectangles, and circles.
View Source →Demonstrates basic file I/O operations writing and reading text files to the host filesystem.
View Source →Renders scrolling text with fontdue library using sine wave animation and VRAM sprite batching.
View Source →Basic GU graphics initialization and display setup showing a colored background.
View Source →Uses GU debug print functionality to render text directly to the graphics display.
View Source →High-level HTTP GET requests via psp::http::HttpClient with WiFi connectivity.
View Source →Reads analog stick input with deadzone normalization and button press detection.
View Source →Demonstrates kernel-mode privileged APIs including ME clock, volatile memory, NAND flash, and hardware registers.
View Source →Text input via on-screen keyboard (OSK) utility with both convenience function and builder pattern.
View Source →Simple drawing application with analog stick control and button-based tool selection.
View Source →Animated rainbow color transitions filling the screen via direct framebuffer manipulation.
View Source →Terminal UI rendering using ratatui library with styled text, borders, and layout widgets.
View Source →Reads RTC date/time with arithmetic and queries system parameters like language and timezone.
View Source →Uses Rust standard library with String, Vec, and format! macros in no_std PSP environment.
View Source →Saves and loads game data with metadata using the PSP savedata utility with GU rendering.
View Source →Renders system fonts with glyph atlas caching using PSP FontLib and FontRenderer API.
View Source →Spawns multiple threads sharing a SpinMutex counter with thread synchronization and join.
View Source →Sets one-shot alarm callbacks and virtual timers with microsecond precision time measurement.
View Source →Performs integer addition using VFPU (Vector FPU) inline assembly with float conversion.
View Source →Demonstrates VFPU context save/restore with matrix operations preserving register state.
View Source →How rust-psp is structured and how your code becomes a PSP executable.
PSP executables require specific ELF sections: .rodata.sceModuleInfo for module metadata,
.lib.stub for import stubs, and .lib.ent for exports. The psp_extern!
macro generates syscall stubs with NIDs (Numeric IDs) — the first 4 bytes of SHA-1(function_name)
in little-endian — which the PSP OS resolves at load time. Module flags 0x0000 for user-mode,
0x1000 for kernel-mode.
The cargo-psp suite handles every step from Rust source to PSP executable.
The main build command. Wraps cargo build, invokes prxgen and pack-pbp automatically, and reads project metadata from Psp.toml. Supports --release, --features, and custom target directories.
Converts a MIPS ELF binary into PSP's PRX (relocatable module) format. Processes import/export tables and fixes up relocations for the PSP loader.
Creates PBP archives — the PSP's executable package format. Bundles the PRX with SFO metadata, optional icons (ICON0.PNG), backgrounds, and startup sounds.
Generates SFO (System File Object) metadata files containing the game title, disc ID, firmware version requirements, and parental control level.
Minimizes PRX files by stripping debug sections and unnecessary ELF data, reducing the final binary size for distribution.
toml # Project metadata for pack-pbp [metadata] title = "My PSP Game" disc_id = "RUST00001" disc_version = "1.00" firmware_version = "6.60" # Optional assets icon0 = "assets/icon.png" pic1 = "assets/background.png" # Localized titles [metadata.titles] japanese = "PSPゲーム" english = "My PSP Game"