Platform:PlayStation
| Developer | Sony Computer Entertainment |
|---|---|
| Uses | Library:Psy-Q SDK |
| Versions | SCPH-1000 to SCPH-9xxx (1994-2000), PSone SCPH-100/101/102 (2000) |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
Sony's first home console (1994 JP, 1995 NA/EU). A MIPS R3000A-compatible CPU (little endian, MIPS I, no FPU) with the GTE geometry coprocessor as COP2, 2 MB of main RAM, 1 MB of VRAM behind the GPU and 512 KB of sound RAM. Games boot from CD through SYSTEM.CNF into a Format:PS-X EXE that is loaded to a fixed address without relocation; most games then load further code overlays to fixed addresses.
Overview
- CPU: 32-bit MIPS R3000A-compatible core (MIPS I instruction set) at 33.8688 MHz, little endian, no floating-point unit. Branch delay slots and load delay slots are visible in disassembly: the instruction after a branch always executes, and a register loaded by
lwis not yet valid in the next instruction. - Coprocessors: COP0 (system control, exceptions) and COP2 = GTE (Geometry Transformation Engine): fixed-point matrix, vector and perspective operations used through
mtc2/mfc2/ctc2/cfc2,lwc2/swc2and GTE command opcodes. Commercial code reaches it through the LIBGTE functions of Library:Psy-Q SDK or inline macros. - Memories: 2 MB main RAM; 1 MB VRAM (a 1024x512 grid of 16-bit pixels holding framebuffers, textures and palettes, reachable only through GPU commands and DMA); 512 KB SPU sound RAM; 1 KB scratchpad (data cache used as fast RAM); 128 KB memory cards.
- Media: double-speed CD-ROM (ISO 9660 with XA extensions; STR/XA streaming). Files have an ISO version suffix, e.g.
DRA.BIN;1.
Memory map
| KUSEG | KSEG0 | KSEG1 | Size | Contents |
|---|---|---|---|---|
0x00000000 |
0x80000000 |
0xA0000000 |
2 MB | Main RAM; the first 64 KB belong to the BIOS kernel |
0x1F800000 |
0x9F800000 |
- | 1 KB | Scratchpad |
0x1F801000 |
0x9F801000 |
0xBF801000 |
4 KB | I/O ports (GPU, DMA, timers, CD, SPU, pads) |
0x1FC00000 |
0x9FC00000 |
0xBFC00000 |
512 KB | BIOS ROM (reset vector at 0xBFC00000)
|
Game code runs in KSEG0 (cached), so pointers in games are almost always 0x80xxxxxx. The same RAM byte can be reached through the three segments and through mirrors; normalise addresses (addr & 0x1FFFFFFF) before comparing addresses taken from different tools or emulator dumps.
Boot and executables
- The BIOS reads
SYSTEM.CNFfrom the CD root. ItsBOOTline names the boot executable, e.g.BOOT = cdrom:\SLUS_000.67;1;TCB,EVENTandSTACKlines set kernel limits and the initial stack. WithoutSYSTEM.CNFthe BIOS bootsPSX.EXE. - Licensed games name the boot executable after the disc serial with the dash replaced by an underscore and a dot after the fifth character: serial
SLUS-00067givesSLUS_000.67. Prefixes give the region and publisher class:SCUS/SLUSNorth America,SCES/SLESEurope,SCPS/SLPS/SLPMJapan (SC = Sony first party, SL = licensee). - The executable is a Format:PS-X EXE: a 0x800-byte header, then an image copied as-is to its load address (usually
0x80010000) with no relocation.
Code organisation in commercial games
- The boot EXE statically links Sony's libraries (Library:Psy-Q SDK), so the first part of most boot executables is library code that can be named by matching against known library objects.
- Larger games keep the game code in overlays: raw code/data files loaded from CD to fixed RAM addresses chosen by the developer, without headers or relocations. Different overlays (one per level, boss or menu) are linked to the same address and replace each other. An address is therefore only meaningful together with the overlay that is loaded; see Software:Castlevania: Symphony of the Night#Architecture overview for a typical layout.
- Overlays usually call the resident engine through a function pointer table at a fixed address (or directly through absolute
jaltargets), and the resident engine calls the overlay through a pointer table at the overlay's start.
Decompilation toolchain
PlayStation games were mostly compiled with GCC 2.x for MIPS shipped in the Psy-Q SDK, with Sony/SN's own assembler (ASPSX). Matching decompilations (Technique:Matching decompilation) rebuild them with an original cc1 binary, an assembler shim (maspsx) that reproduces ASPSX's macro expansion, and GNU binutils for MIPS. Splitting is done with splat, C is drafted with m2c, and functions are compared with asm-differ or objdiff.
Disc and media formats
Data on a PlayStation disc sits in layers: raw 2352-byte sectors (Format:CD-ROM XA, stored as Format:CUE and BIN images), the file system (Format:ISO 9660 with CD-XA fields), then the files. Boot files are Format:PS-X EXE. Common media files: textures Format:TIM (PlayStation texture); audio Format:VAG, banks Format:VAB and sequences Format:SEQ and SEP, all built on Format:SPU-ADPCM (PlayStation); movies Format:STR (PlayStation video). Many games pack these into their own archives, so scan for the magics (TIM 10 00 00 00, VAGp, pBAV, pQES; STR sectors start with the status word 0x0160, bytes 60 01).
See also: Format:TMD (PlayStation 3D model) for models, Format:MDEC (PlayStation macroblock decoder) for the movie decoder behind Format:STR (PlayStation video), and Format:SYSTEM.CNF (PlayStation boot file) for the boot file.
Topics
- BIOS calls — How software calls the PlayStation (PS1) BIOS kernel: jumps to the A0/B0/C0 vectors at 0xA0, 0xB0 and 0xC0 with the function number in register r9 ($t1), the…
Code & repositories
- https://github.com/psx-spx/psx-spx.github.io @
6d7d1bc106a7e0b616b0330fe58401ab1ba57f0f· license: none
psx-spx: the PlayStation hardware and file format documentation (docs/kernelbios.md for BIOS A/B/C tables and Exec, docs/cdromfileformats.md for PS-X EXE, SYSTEM.CNF and CPE, docs/controllersandmemorycards.md for the memory card format). No license file was found in the repository root; only facts are cited, no text copied.
Tested on: source read, not run: documentation read, nothing run · checked 2026-10-19; last activity 2026-10-19; no license: not reusable - https://github.com/stenzek/duckstation @
9766391b610fd836ffda0b3e47ab098d04f72ee8· license: CC-BY-NC-ND-4.0 (declared by the contributor; GitHub's detector did not recognize LICENSE)
DuckStation PS1 emulator (CC BY-NC-ND 4.0 per its SPDX headers: facts only, never copy code): src/core/bios.cpp and bios.h (PS-EXE header and region marker), bios_types.h (thread control block), system.cpp (SYSTEM.CNF BOOT parsing), memory_card_image.cpp (memory card format and import).
Tested on: source read, not run: source read, not run or built · checked 2026-10-19; last activity 2026-10-19; Note: the latest release ships binaries; the wiki links only the source, never the binaries
Pitfalls
- File offset is not RAM address: in a PS-X EXE the image starts at file offset
0x800and is loaded to the header's load address, soRAM = load address + (file offset - 0x800). - Overlays loaded to the same address collide in a single disassembler database. Use one database (or one overlay block) per overlay file.
- Code compiled with
-G0never uses$gp-relative addressing; code compiled with a small-data threshold does, and then$gpmust be set to the header's initial GP for references to resolve. - The memory controller supports an 8 MB RAM layout: DuckStation (commit 8a5b99b8b3) decodes the RAM_SIZE register (
src/core/bus.cpp, 8 MB modes in theRAM_SIZE_REGswitch,RAM_8MB_SIZE = 0x800000inbus.h) and exposes it as the settingcpu_enable_8mb_ram, so code can see 8 MB mirrors or extra RAM on such a machine. Unverified: that this configuration is what development kits shipped with; no source read here says so. Code paths that use addresses above0x80200000are likely development-only; test by checking whether such a path is reachable on retail hardware or an emulator in retail mode.
Evidence & references
- psx-spx (nocash PlayStation specifications, community maintained at psx-spx.consoledev.net): memory map, SYSTEM.CNF and EXE header.
- The memory layout and boot path were cross-checked with the matching decompilation of Software:Castlevania: Symphony of the Night.