Toolkit for porting standard SDL2 programs to PlayStation Vita with minimal changes to the app itself.
Link vitadev, call vitadev_init(), swap fopen → vd_fopen and texture helpers where needed, add a vitadev_package() CMake stanza — done.
- vdpm packages installed (
SDL2etc.) - CMake 3.16+
Uses raylib from ~/src/raylib (override with -DRAYLIB_ROOT=/path/to/raylib).
cd ~/src/vitadev
cmake -S . -B build-native
cmake --build build-native --target raylib-demo
./build-native/examples/raylib-demo/raylib-demoFollows raylib-5.5-vita. Requires full vitaGL with GLSL translator (vdpm's minimal vitaGL is not enough — the install script rebuilds it).
Vita device prerequisite: libshacccg.suprx (runtime shader compiler). Without it, apps crash during the first shader link.
On many Vitas, files copied via USB land in ux0:data/ but vitaShaRK looks in ur0:/data/ — our vitaGL build tries both. Copy the file:
# After USB mount (VitaShell → USB)
cp /path/to/libshacccg.suprx /Volumes/Untitled/data/Or install properly with ShaRKF00D (writes to ur0:/data/).
export VITASDK=~/vitasdk
export PATH=$VITASDK/bin:$PATH
./scripts/install-raylib-vita-deps.shThen build:
cmake -S . -B build-vita -DVITADEV_VITA_BUILD=ON \
-DCMAKE_TOOLCHAIN_FILE=$VITASDK/share/vita.toolchain.cmake
cmake --build build-vita --target raylib-demo.vpk-vpkOutput: build-vita/examples/raylib-demo/raylib-demo.vpk
Note: This replaces SDL2 in vitasdk with the vitagl fork. Restore vdpm SDL for pac-c:
./scripts/restore-vdpm-sdl.shSDL-based ports (pac-c) and raylib ports use different SDL builds — don't mix without restoring.
- VitaShell → USB (mounts as
/Volumes/Untitledon macOS) - Copy the VPK and ROMs:
cp build-vita/examples/pac-c/pac.vpk /Volumes/Untitled/
mkdir -p /Volumes/Untitled/data/PACM00001/roms
cp /path/to/pacman/roms/* /Volumes/Untitled/data/PACM00001/roms/- Eject, VitaShell → install
pac.vpk→ launch
| Module | Purpose |
|---|---|
vitadev/init |
Heap cap, AppUtil boot, ux0:data/<TITLEID>/, SDL Vita hints |
vitadev/fs |
vd_fopen, vd_read_file, vd_mkdir_p — desktop + Vita |
vitadev/sdl |
ABGR8888 textures; RGB24 → GPU lock (no UpdateTexture copy on Vita) |
vitadev/timing |
vitadev_frame_tick(), vitadev_set_turbo(), vitadev_real_get_ticks() |
vitadev/fps |
On-screen FPS counter (vitadev_fps_draw) |
vitadev/input |
Vita joystick button constants (VITA_JOY_*) |
vitadev_package() |
CMake macro: ELF → VPK |
vitadev_link_raylib_app() |
CMake helper: desktop raylib from ~/src/raylib, Vita from third_party/raylib-5.5-vita |
When linked against vitadev on Vita, these SDL functions are wrapped:
SDL_GetTicks— logical clock capped to ~60 Hz for stable simulationSDL_RenderPresent— flushes pending texture uploads; advances logical clock
Call vitadev_set_turbo(true) to disable the frame cap (hold-to-run-fast).
vitadev_init()with yourTITLEIDat startup (beforeSDL_Init)- Replace file I/O with
vd_fopen/vd_read_filewhere paths hitux0:data/ - Use
vd_create_texture+vd_update_texture_rgb24for RGB24 framebuffers - Map Vita joystick in
#ifdef __vita__blocks (handheld isSDL_Joystick, not GameController) - Add
vitadev_package()to CMake
Small spinning-shapes demo. Same source compiles natively and for Vita.
# Native
cmake --build build-native --target raylib-demo
# Vita
cmake --build build-vita --target raylib-demo.vpk-vpkCopy of superzazu/pac in examples/pac-c/. Exercises display, audio, gamepad, and filesystem I/O.
| Button | Action |
|---|---|
| D-pad | Move |
| Select | Insert coin |
| Start | 1-player start |
| R (hold) | Uncapped speed — uses wall-clock emulation, skips most display refreshes |
Yellow FPS counter top-left; orange bar = turbo active.
ROMs: ux0:data/PACM00001/roms/ — see examples/pac-c/roms/README.txt
vitadev/
├── include/vitadev/ headers
├── src/ libvitadev.a
├── cmake/ Vitadev.cmake, VitadevRaylib.cmake, RaylibVita.cmake
├── third_party/
│ ├── raylib-5.5-vita/ Vita raylib port (vitaGL)
│ └── SDL-vitagl/ Northfear SDL2 fork (OpenGL via vitaGL)
└── examples/
├── raylib-demo/ native + Vita demo
└── pac-c/ SDL reference port
.c sources → arm-vita-eabi-gcc → ELF
→ vita-elf-create → VELF
→ vita-make-fself → eboot.bin
→ vita-mksfoex → param.sfo
→ vita-pack-vpk → .vpk