Format:CPE (Psy-Q executable)
| Platforms | Platform:PlayStation |
|---|---|
| Magic | 43 50 45 01 (CPE, 1) |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Psy-Q's debug executable of the PlayStation (.cpe): the magic bytes 'CPE' and 01, a version, then a stream of one-byte opcodes (load data, set register, select unit) that sets the entry point through register 0x90.
Overview
The CPE file is the chunked executable that the Psy-Q toolchain (Library:Psy-Q SDK) produced for development kits; it is not the retail Format:PS-X EXE, which has a fixed 0x800-byte header. Emulators and loaders (PCSX-Redux src/supportpsx/binloader.cc, MIT) accept both.
Layout as PCSX-Redux reads it
All values little endian. A 32-bit magic 0x01455043 (bytes 43 50 45 01), then a 16-bit field the loader skips, then opcodes read one byte at a time until a 0 byte:
| Opcode | Operands | Meaning |
|---|---|---|
| 1 | u32 address, u32 size, then size data bytes | load data to address |
| 2 | u32 | read and ignored by PCSX-Redux |
| 3 | u16 register, u32 value | set a 32-bit register value |
| 4 | u16 register, u16 value | set a 16-bit register value |
| 5 | u16 register, u8 value | set an 8-bit register value |
| 6 | u16 register, u16 low, u8 high | set a 24-bit register value |
| 7 | u32 | read and ignored |
| 8 | u8 | read and ignored (select unit) |
Of the register writes the loader only uses register 0x90, which it takes as the program counter (entry point). Opcode meanings other than these are Unverified beyond the loader's behaviour; the psx-spx document "CDROM File PsyQ .CPE Files" describes the same opcodes.
Recognition
First four bytes 43 50 45 01. Code is loaded to the addresses given by opcode 1; there is no 0x800 header and no region text.
Code & repositories
- https://github.com/grumpycoders/pcsx-redux @
e58d0892c8e824bd7d5da847290f6811331215e5· license: GPL-2.0-or-later (declared by the contributor for the files used; GitHub reports GPL-2.0 for the repository)
PlayStation emulator and tooling (GPL-2.0 overall; the files read, src/supportpsx/binloader.cc, carry the MIT license): the loaders for PS-X EXE, CPE and PSF files.
Tested on: source read, not run: source read, not run: binloader.cc read from a raw file · checked 2026-10-18; last activity 2026-10-18