Psy-Q
Development kit of compiler tools and Sony's run-time library for PlayStation programs.
This is an old revision of this page, as edited by RemmyLee at 03:05, 23 October 2026. Edit this revision | Latest revision
Overview
Psy-Q is the set of compiler, assembler and linker programs that build PlayStation programs. Sony distributed it on the Programmer Tools CD (DTL-S2002) in the \PSYQ directory. The run-time library was on the same CD in the \PSX directory. The \PSX directory contains the "lib" and "include" directories for compiling code, and the \PSYQ directory contains the Psy-Q development libraries.1
A program therefore uses both. It calls the functions of the run-time library (libgpu, libgte, libspu, libcd and the others listed below), and the Psy-Q tools compile it and link those libraries into the executable. The Psy-Q linker links libgs, libgte, libgpu, libetc, libapi and libsn automatically unless the -nostdlib option is given.2
The GNU compiler parts of the distribution are "provided by Psy-Q" and are derived from GNU source files. They may be used only under the terms of the GNU public license, and they must be copied into the \psyq directory before the tools are complete.13
CCPSX
CCPSX is the control program of the tools. It accepts a list of source files and option switches, and it calls the C pre-processor, the C compiler, the assembler and the linker as each file requires.2
The case of a switch is significant, so -O and -o are different options. A long command line can be kept in a control file. Writing an @ sign before the file name embeds its contents in the command line: ccpsx @main.cf -o main. A control file may span several lines and may refer to another control file.2
CCPSX finds its programs through environment variables, which are normally set in AUTOEXEC.BAT:2
| Variable | Content |
|---|---|
| COMPILER_PATH | Directory of the compiler executables. With the GNU C compiler CCPSX looks there for CPPPSX.EXE, CC1PSX.EXE and CPLUSPSX.EXE. |
| PSYQ_PATH | Directory of the Psy-Q executables, such as PSYLINK.EXE |
| C_INCLUDE_PATH | Directory of the standard C header files, searched for an #include in angle brackets |
| LIBRARY_PATH | Directory of the standard library files |
| TMPDIR | Directory for temporary files made during compilation |
The CCPSX documentation gives the following settings as an example. The run-time library headers and libraries are in c:/psx, and the Psy-Q programs are in c:/psyq. The paths use forward slashes.2
set COMPILER_PATH=c:/psyq
set PSYQ_PATH=c:/psyq
set C_INCLUDE_PATH=c:/psx/include
set LIBRARY_PATH=c:/psx/lib
set TMPDIR=c:/
CCPSX decides how to process each source file from its extension.2
| Extension | Stages |
|---|---|
| .C | C pre-processor, C compiler, Assembler, Linker |
| .I | C compiler, Assembler, Linker |
| .CC, .CPP | C pre-processor, C++ compiler, Assembler, Linker |
| .II, .IPP | C++ compiler, Assembler, Linker |
| .ASM | C pre-processor, Assembler, Linker |
| .S | Assembler, Linker |
| other | Linker |
The CCPSX documentation calls PSYLINK the standard Psy-Q linker. An option of the form -Xoption passes /option to the linker, so any linker option can be given through CCPSX.2
Programs
The BIN directory of the Psy-Q 4.6 distribution holds the following programs. The CCPSX documentation names the role of four of them; the others are listed by file name only.4
| Program | Use |
|---|---|
| CCPSX.EXE | Control program that runs the stages below2 |
| CPPPSX.EXE | C pre-processor (GNU)2 |
| CC1PSX.EXE | C compiler (GNU)2 |
| CC1PLPSX.EXE | |
| ASPSX.EXE | |
| ASMPSX.EXE | |
| PSYLINK.EXE | Linker2 |
| PSYLIBD.EXE | |
| PSYMAKE.COM | |
| PSYQ.INI |
Sony released new versions of the GNU parts with the run-time library. Release 4.7 updated ASPSX, CC1PSX, CC1PLPSX and CPPPSX, added the source of gcc 2.95 and removed the source of gcc 2.8.1. The 4.7 notes list these files under "SDevTC Tools" in a directory named pssn.5
LIBSN
LIBSN is the library of Psy-Q functions, declared in libsn.h. It is one of the libraries the linker links by default.62
The release of 20 September 1995 added SNFlushCache(). It replaces the FlushCache() function of the run-time library. The library version must be called with interrupts off, and the replacement does not have that limitation and runs faster. It has a different name so that it can be told apart from the version in the other PlayStation libraries.6
The startup modules in Sony's samples are marked "SN Systems replacement for main module".7
Run-Time Library
The run-time library is Sony's. Release 3.6 was the current release on the Programmer Tools CD of November 1996, and the CD kept release 3.5 in its \OLD_LIBS directory.1 Later releases include 4.4, whose Library Overview is dated January 1999, and 4.7 of February 2000.85
The LIB directory of release 4.7 holds the following libraries and objects:9
| File | Page |
|---|---|
| LIBAPI.LIB | libapi |
| LIBC.LIB, LIBC2.LIB | libc |
| LIBMATH.LIB | libmath |
| LIBETC.LIB | libetc |
| LIBGPU.LIB | libgpu |
| LIBGTE.LIB | libgte |
| LIBGS.LIB | libgs |
| LIBHMD.LIB | libhmd |
| LIBCD.LIB | libcd |
| LIBDS.LIB | libds |
| LIBPRESS.LIB | libpress |
| LIBSPU.LIB | libspu |
| LIBSND.LIB | libsnd |
| LIBPAD.LIB, LIBTAP.LIB, LIBGUN.LIB | libpad |
| LIBCARD.LIB | libcard |
| LIBMCRD.LIB | libmcrd |
| LIBMCX.LIB | libmcx |
| LIBCOMB.LIB | libcomb |
| LIBSIO.LIB | libsio |
| LIBSN.LIB | LIBSN, above |
| MCGUI.OBJ, MCGUI_E.OBJ | mcgui |
| 2MBYTE.OBJ, 8MBYTE.OBJ, NOHEAP.OBJ, NONE3.OBJ, NOPRINT.OBJ, POWERON.OBJ | Link-time objects |
Conversion Tools
Sony shipped data conversion tools with the library. Release 4.4 lists the following graphics tools:10
| File Name | Version | Release Date | Explanation |
|---|---|---|---|
| bmp2tim.exe | 2.2 | 96/01/25 | Converter from BMP to TIM |
| dxf2rsd.exe | 2.81 | 96/04/25 | Converter from DXF to RSD |
| labp.exe | 1.12 | 98/01/12 | Label processor and HMD assembler |
| meshconv.exe | 1.2 | 98/01/12 | MSH (extended RSD file) creator |
| mimefilt.exe | 1.51 | 96/04/01 | MIMe difference file creator |
| mimesort.exe | 2.1 | 96/06/11 | TMD vertex information sorting tool |
| mkmime.exe | 1.12 | 98/07/12 | MIMe HMD creator |
| mktod.exe | 1.4 | 96/05/01 | TOD creator |
| pict2tim | 3.1 | 94/10/13 | Converter from PICT to TIM |
| rgb2tim.exe | 2.1 | 96/04/01 | Converter from RGB to TIM |
| rsd2dxf.exe | 1.00 | 94/10/11 | Converter from RSD to DXF |
| rsd2hmd.exe | 1.5 | 98/01/12 | Converter from new RSD to HMD |
| rsdcat.exe | 1.06 | 97/08/18 | RSD catenation tool |
| rsdform.exe | 1.81 | 96/04/01 | RSD modification tool |
| rsdlink.exe | 3.72 | 96/10/01 | Converter from RSD to TMD |
| rsdup.exe | 1.1 | 98/01/12 | Converter from RSD to new RSD |
| tim2bmp.exe | 1.2 | 98/05/01 | Converter from TIM to BMP |
| timpos.exe | 1.1 | 96/05/01 | TIM VRAM address changing tool |
| tmd2pmd.exe | 1.14 | 95/10/05 | Converter from TMD to PMD |
| tmdinfo.exe | 1.25 | 96/04/01 | TMD information tool |
| tmdsort.exe | 1.25 | 96/04/01 | TMD sorting tool |
| xhmd.exe | 1.20 | 98/09/21 | HMD disassembler |
| movconv.exe | 2.2 | 97/08/06 | Movie data converter |
| movpack.exe | 1.6 | 97/08/06 | XA and STR interleave tool |
| mc32.exe | 3.2 | 98/09/22 | Movie data converter, 32-bit version |
The sound tools of the same release are as follows:11
| File Name | Version | Release Date | Explanation |
|---|---|---|---|
| aiff2vag.exe | 3.3 | 98/09/22 | Waveform data converter to VAG |
| mkvab.exe | 2.0 | 96/05/01 | VAB (music bank) creator |
| seq2sep.exe | 1.0 | 95/03/09 | SEP packer |
| smf2seq.exe | 2.4 | 98/09/22 | Sequence data converter to SEQ |
| vabsplit.exe | 2.0 | 96/05/01 | VAB splitter |
References
-
^ a b c Sony Computer Entertainment Inc. Programmer Tools CD (DTL-S2002), README.TXT. 11/26/96. Sections "CD-ROM Contents" and "CD-ROM Contents - Highlights".
-
^ a b c d e f g h i j k l PlayStation Programmer Tools, \psyq\bin\DOC\CCPSX.TXT, "A Brief Introduction To Using CCPSX". Sections "What It Does", "Command Line Format", "Environment Variables" and the linker section.
-
^ Sony Computer Entertainment Inc. Programmer Tools CD (DTL-S2002), \psyq\README.TXT, "GNU Contents". 12/12/96.
-
^ Psy-Q 4.6 distribution, BIN directory listing.
-
^ a b Sony Computer Entertainment Inc. Runtime Library Release 4.7, LIB\readme.txt, "Library Changes, New Additions, and Known Bugs from Release 4.6". February 2000. Section "SDevTC Tools".
-
^ a b PlayStation Programmer Tools, \psyq\src\LIBSN\README.TXT. LIBSN dated 20-Sep-95.
-
^ PlayStation Programmer Tools, \psx\sample\scea\SAMPLER\STARTUP\STARTUP.S, line 1.
-
^ Sony Computer Entertainment Inc. Run-Time Library Overview. January 1999. About This Manual.
-
^ Sony Computer Entertainment Inc. Run-Time Library Release 4.7, LIB directory listing.
-
^ Sony Computer Entertainment Inc. PlayStation Programmer Tools, \psyq\bin\README_E.TXT, graphics tools list. Document Release 1.0 for Run-time Library Release 4.4.
-
^ Sony Computer Entertainment Inc. PlayStation Programmer Tools, \psyq\bin\README_E.TXT, sound tools list. Document Release 1.0 for Run-time Library Release 4.4.