Platform:PlayStation 2
| Vendor | Sony |
|---|---|
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Sony's second home console (2000 JP). Its main CPU is the Emotion Engine (EE, a little-endian MIPS R5900 with 128-bit registers, vector units VU0/VU1), and an I/O Processor (IOP, a PlayStation 1 R3000A CPU) runs separate IRX modules; game executables are ELF files.
Overview
The PlayStation 2 has two programmable CPUs that matter to a reverser:
- Emotion Engine (EE): MIPS R5900, little endian, 32 general registers of 128 bits (the multimedia instructions
lq/sqload and store a full quadword), two vector units (VU0, VU1) with their own micro-programs. Game code runs here. - I/O Processor (IOP): a MIPS R3000A (the same core as Platform:PlayStation) that drives the disc, pads, memory cards, USB and sound through IRX modules loaded at run time (Format:IRX (PlayStation 2 IOP module)).
The boot executable on a disc is named in SYSTEM.CNF and is a normal 32-bit MIPS little-endian Format:ELF (Executable and Linkable Format). In the Sly Cooper decompilation the entry point _start of the NTSC-U executable is at 0x100008, i.e. EE programs are linked from the bottom of RAM at about 0x100000.
Toolchains seen in matching decompilations
- Sony/SN Systems ProDG
ee-gcc2.95.2 (build v2.73a) for C and C++ games of the first generation; flags-O2 -G0 -ffast-mathin Software:Sly Cooper and the Thievius Raccoonus. C++ names follow the old GCC 2 schemeFunction__[qualifier]Args. - The splat disassembler supports
platform: ps2andcompiler: EEGCC; see Tool:splat.
Recognising PS2 code
- Prologue/epilogue saving
$s0-$s7withsq/lq(16-byte stack slots) instead ofsw/lw. $gpinitialised to a fixed value (Sly 1:_gpReg=0x2832F0) so small data is reached with$gp-relative loads.- IOP modules are separate
.IRXfiles (or inside an IOPRP image) loaded over RPC.
Further reading
The PS2SDK (open source, AFL 2.0, https://github.com/ps2dev/ps2sdk) documents the module formats and IOP kernel headers.
Data formats
- Boot:
SYSTEM.CNFwith aBOOT2line, see Format:SYSTEM.CNF (PlayStation boot file); the named file is an ELF, I/O processor drivers are Format:IRX (PlayStation 2 IOP module). - Textures: Format:TIM2 (PlayStation 2 texture) (magic "TIM2"); PS1 data such as Format:TIM (PlayStation texture), Format:VAG and Format:SPU-ADPCM (PlayStation) also appears on PS2 discs because the sound hardware is compatible.
- Saves: Format:PS2 memory card image (text "Sony PS2 Memory Card Format" at offset 0) and the single-save exports Format:PSU and MAX (PS2 save containers).
- Video: Unverified: PS2 movies are usually MPEG-2 program streams with the extension .pss (pack start code 00 00 01 BA, Sony private streams for audio); the PSMF variant is the PSP's. No source was read for this.
- Unverified: EE ELF games start at
_startfrom a crt0 that clears BSS, sets$gpand callsmain; only the Sly Cooper decompilation values were read (see Overview). - Executables: the EE game ELF is described on Format:PS2 EE executable (ELF) (e_machine 8, R5900 flag 0x00920000 in e_flags, how PCSX2, ps2sdk and splat treat it).
- Saves: the per-save descriptor file is Format:PS2 icon.sys (964 bytes, "PS2D").
Code & repositories
- https://github.com/TheOnlyZac/sly1 @
ea5e2d77ac2a083df1efeafcee178f895943b13d· license: CC0-1.0
Matching decompilation of Sly Cooper and the Thievius Raccoonus (NTSC-U SCUS_971.98) for PS2. Useful without building: config/sly1.yaml (splat segments), config/symbol_addrs.txt (about 5,400 names and addresses), config/checksum.sha1, docs/mips_ps2_cheatsheet.md, configure.py (ee-gcc 2.95.2 flags).
Tested on: source read, not run: Read at commit ea5e2d7: config files, README, configure.py; not built (needs the game disc) · checked 2026-10-18; last activity 2026-10-11 - https://github.com/ps2dev/ps2sdk @
329e2bb43287e16af16c4dde1c614e2662c24468· license: AFL-2.0 (declared by the contributor; GitHub's detector did not recognize LICENSE)
Open-source PS2 SDK (AFL-2.0): IOP kernel headers (iop/kernel/include/irx.h, iop/system/loadcore) giving the IRX import/export table layout, tools/ps2-irxgen and tools/srxfixup for the IRX ELF type 0xFF80 and .iopmod section, tools/romimg for ROM images.
Tested on: source read, not run: Read at commit 329e2bb: irx.h, udnl ELF.h, ps2-irxgen elftypes.h; not built · checked 2026-10-18; last activity 2026-10-13