Skip to content
Djakson edited this page Jul 21, 2022 · 4 revisions

The homebrew PlayStation 2 Source Development Kit (PS2SDK)

Welcome to the ps2sdk wiki!

The homebrew PlayStation 2 Source Development Kit is a collection of libraries and programs for enabling a developer to develop applications for the Sony PlayStation PlayStation 2® (PS2) console. It contains the work from a number of projects, which are now buildable in a single source tree. Review the history section for how the ps2sdk came about.

At the time of writing PS2SDK includes the following libraries and features, allowing:

  • Access to PS2 kernel functions.
  • Access to PS2 SIO2 peripherals, the controler pad, memory card and multitap.
  • Access to USB devices, such as the mouse, keyboard and USB mass storage devices.
  • Access to i.Link.
  • Network access through a full TCP/IP stack, compatible with the official PS2 Ethernet Adapter.
  • Support for the Hard Disk Drive and the official file systems.
  • Access to the CD/DVD drive.
  • Mini optimised C library for most string operations.
  • Access to sound library on all PS2 models, using the homebrew sound library (freesd).

The PS2SDK has been developed by a large number of individuals, who have contributed their time and effort. The AUTHORS file includes this list of these contributors.

The PS2SDK is licensed under the Academic Free License version 2.0. This is a very liberal license and allows both commercial and non-commercial usage of the SDK. Please read the LICENSE file for full details.

Binary Installation

The ps2sdk provides a large number of the basic software libraries required to access the underlying PS2 system. As the PS2 has two independant CPUs - the Emotion Engine (EE) and the IO Processor (IOP), the source tree is split into two different major areas representing the functions available on each processor.

Building and installing

  1. Install the toolchain and have $PS2SDK exported.
  2. git clone https://github.com/ps2dev/ps2sdk
  3. cd ps2sdk
  4. export PS2SDKSRC=$PWD
  5. make clean
  6. make
  7. make install

Note: ensure that you have the necessary privileges before executing make install.

Upgrading

  1. Get an updated copy of the PS2SDK:
    1. If you have not cloned a copy before:
      1. git clone https://github.com/ps2dev/ps2sdk
      2. cd ps2sdk
    2. If you alread have a copy:
      1. cd ps2sdk
      2. git pull
  2. export PS2SDKSRC=$PWD
  3. make clean
  4. make
  5. make install

Note: ensure that you have the necessary privileges before executing make install.

Binary Release Structure

A binary release of PS2SDK will include the following directories:

  • sdk/ee/include: EE include files.
  • sdk/ee/lib: EE library files.
  • sdk/ee/startup: Example crt0.o and linkfile.
  • sdk/iop/include: IOP include files.
  • sdk/iop/irx: IOP loadable modules.
  • sdk/common/include: Common include files between the EE and IOP.
  • sdk/samples: Samples for both EE and IOP.
  • sdk/tools: Tools used during development on the host PC.

Source Structure

The ps2sdk source tree is considerably different from the binary or release distribution. The source tree is a built as a collection of seperate projects; each with their own Make file. The file Defs.make provides the basic definitions required when building PS2SDK. The two main variables required are PS2SDKSRC, which points to the source base directory, and PS2SDK, which points to the release directory.

The main make file has three targets:

  • all/default: compile each of the projects in the tree.
  • clean: clean the tree of files created during build.
  • release: release the binaries to the target PS2SDK directory.

Each sub project has a tree structure which can include:

  • src: source code
  • include: include files which are exported
  • samples: samples of using a project. Can include multiple directories
  • doc: documentation files to be exported.
  • test: Unit Testing or other testing code.
  • obj: created during build to store object files
  • lib: created during build to store library files
  • bin: created during build to store binary files

Please review the Makefiles to see how to create your own subproject in the tree.

Graphics Synthesizer

The Graphics Synthesizer is the powerful graphics chip of the PlayStation 2. For more details, please refer to this page: Graphics Synthesizer