PSY-Q
Official SDK provided by Sony Computer Entertainment to develop software for the PlayStation 1.
MS-DOS based versions
- PSY-Q 2.0 (Programmer Tool Runtime Library Version 2.0, DTL-S2160)
- PSY-Q 2.6 (Programmer Tool Runtime Library Version 2.0, DTL-S2170)
- PSY-Q 3.0 (Programmer Tool Runtime Library Version 2.0, DTL-S2180)
- PSY-Q 3.3 (Programmer Tool Runtime Library Version 2.0, DTL-S2190)
- PSY-Q 3.5 (Programmer Tool Runtime Library Version 2.0, DTL-S3000)
- PSY-Q 3.6 (Programmer Tool Runtime Library Version 2.0, DTL-S3040)
Win32 based versions
- PSY-Q 4.0
- PSY-Q 4.3
- PSY-Q 4.4
- PSY-Q 4.5
- PSY-Q 4.6
C Compilers
Fork from GCC. Prior to PSY-Q 3.6, the compiler was shipped separately in a floppy disk called "GNU C Compiler Version 2.60 (World)", which closely resembles a late build from GCC 2.6.3 with some patches from the 2.7.0 branch (this is a speculation).
- GCC 2.6.0 [AL 1.1, MM40]: found in GNU C Compiler Version 2.60 (World)
- GCC 2.7.2 [AL 1.1, MM40]: found starting from PSY-Q 3.6 and in the Yaroze SDK
- GCC 2.7.2.SN32.3.7 Build 0001: found starting from PSY-Q 4.0
- GCC 2.8.1 SN32 BUILD 4.0.0010: found in PSY-Q 4.3, includes the source code
- TODO GCC 2.91.66: PSY-Q 4.5?
- 2.95.2 19991024 BUILD 4.0.0030: found starting from PSY-Q 4.6
PSY-Q 3.6 uses a much later build from GCC 2.6.3 and it seems to be the very last compiler that is MS-DOS compatible.
Starting from PSY-Q 4.0 there is a fully fledged 32-bit compiler from the GCC 2.7.2 branch and onwards.
Please refer to GCC for patterns, tips and tricks.
Assemblers
The PSX SDK widely uses a custom assembler called ASPSX.
- ASPSX 1.07: found starting from PSY-Q 2.6 (DTL-S2170)
- ASPSX 2.21: found starting from PSY-Q 3.3 (DTL-S2190)
- ASPSX 2.34: found starting from PSY-Q 3.5 (DTL-S3000)
- ASPSX 2.56: found starting from PSY-Q 4.0
- ASPSX 2.79: found starting from PSY-Q 4.3
- ASPSX 2.86: found starting from PSY-Q 4.6
The only known GNU AS build is found in DTL-S3040 and in the Yaroze SDK, built for MS-DOS. It is compiled from binutils 2.6 (using BFD 2.6) and it internally targets mips-sony-psx.
ASPSX is known to produce different output than GNU AS. The pseudo-instructions li and move are vastly different from GAS, but even between ASPSX 2.34 and ASPSX 2.56. You can still get matches using some specifically crafted assembly macros. It also expands lb, lbu, lh, lhu and lw by using the $at register instead of the actual used register. This can be mitigated with a patcher injected in the compilation pipeline between CC1 and GAS (eg. maspsx). Last, but not least, ASPSX sometimes produces jumps to the pseudo-instruction nop, which maspsx also patches.
Binary sections
- .text
- .data
- .bss
- .sdata
- .sbss
- .rdata
- .rodata
- .init
- .fini
TODO: what's the default sections order for EXEs?
TODO: what's the section order for overlays from the SDK samples?
PSY-Q version detection
The signatures of the PSY-Q libraries can be found on GitHub. Be aware that certain games might use a mix of libraries across different PSY-Q versions. The compiler and assembler are also not necessarily bound to a specific set of PSY-Q libraries.