Playstation2 Linux Games Programming

 

 

I lecture on the Undergraduate and Postgraduate Computer Games courses in The Institute of Arts, Media and Computer Games at The University of Abertay Dundee (UK). One of my teaching interests is programming game consoles. At Abertay University we have a game console programming laboratory containing around 40 PlayStation2 Linux Development Kits. These pages hope to help those of you who would like to create games and graphics applications using the Playstation 2 Linux Development Kit.

 

If you have any comment on these tutorials, I can be contacted via this email h.s.fortuna@abertay.ac.uk.

 

A number of people have contributed to these tutorials and I would like to thank:

 

Jonathan Hobson (kazan) for providing some of the program code and text.

Alex Mole (lordbosh) for providing the controller pad code.

Steven Osman (sauce) for developing and making available SPS2.

Sarah Ewen (sarahe) for providing support from Sony Computers Entertainment Europe.

Sony Computer Entertainment Europe for making the PlayStation2 Linux Kit Available.

Contributors to the developers forum at playstation2-linux.com for invaluable help and support.

And my Students (too many to mention by name) who have contributed countless ideas and resources - this site is dedicated to their indefatigability in the pursuit of knowledge.

 

For the majority of these tutorials you will need the Direct PS2 Access Environment. Some tutorials require the Vector Unit Command Line Pre-Processor. Both of these resources are no longer available since the Sony PS2 Linux site has gone offline, but if you contact me I should be able to help.

 

One final word – these tutorials are not coded in the highly optimised manner that you might find in professional game code. The tutorials are meant to illustrate development methods and techniques and are therefore written in an instructive manner that should enlighten the reader.

 

Have fun.

 

(Note: The manuals referred to in the text of the tutorials can be found in the directory sm_pdf which is in the root directory of DVD 1 that comes with the Kit.)

 

 

PlayStation2 Linux Programming Articles

 

PlayStation2 In Higher Education - So You Want To Be A Games Programmer? - Read Article.

Teaching Console Games Programming with the Sony PlayStation2 Linux Kit (5th Game-On Conference, Reading (UK) 2004) - Read Article.

PlayStation2 In Higher Education (Higher Education Academy Presentation November 2005) - View Presentation.

The PS2 Direct Memory Access Controller - Read Article

Using the DMAC in Games Programming - Read Article

 

 

PlayStation2 Linux Games

 

A selection of PS2-Linux games and demos can be found - here

 

 

Application Framework Files

 

The most recent version of the Framework files for creating 2D Applications can be obtained here.

The most recent version of the Framework files for creating 3D Applications can be obtained here.

 

 

Tutorials

 

The following tutorials are split into groups. The Introductory Tutorials describe the prerequisites required in order to get started with PS2-Linux development. The 2D Graphics Tutorials introduce the techniques associated with 2D games development such as the drawing and manipulation of 2D sprites. There are then some General Tutorials which provide more infrastructure support applications such as rendering text, using the co-processors and taking screen captures. The 3D Graphics Tutorials introduce the techniques that open up the full potential and power of the PS2. These tutorials introduce the use of Vector Unit 1 for vertex transformation and lighting. A number of other tutorials are provided in this section for loading 3D models and manipulating the movement and position of objects within a 3D world.

 

In the Applications Framework section, a basic framework is provided for creating games. The framework provided a state machine implementation for controlling the flow of the game. A 3D API which includes 3 directional lights and ambient light is provided for developing 3D games, and an Audio framework is provided for including sound effects and music within an application. The Network Gaming with Sockets tutorials provide information on implementing network gaming within applications under PS2-Linux and the final section on Technical Demos illustrates some more advanced techniques in action such as split screens and sky boxes.

 

 

TUTORIAL

sps2dev-0.4.0

Screen Shots

 
 
INTRODUCTORY TUTORIALS
Getting Started Download Code Screen Shot
Using the Control Pads Download Code Screen Shot
Control Pad Manager Class Download Code Screen Shot

Developing With Microsoft Visual C++ .NET

Download Code Screen Shot
Development Framework Wrapper Classes Download Code Screen Shot
     
     
     

2 DIMENSIONAL GRAPHICS TUTORIALS

Drawing 2D Primitive with a Dynamic Packet 1 Download Code Screen Shot
Drawing 2D Primitives with a Dynamic Packet 2 Download Code Screen Shot
Drawing 2D Primitives with a Static Packet Download Code Screen Shot
Introducing the Z-Buffer Download Code Screen Shot
A simple 2D game framework Download Code Screen Shot
2D Texture Mapping Download Code Screen Shot
2D Sprite Movement and Animation Download Code Screen Shot
2D Sprite Movement With Angles Download Code Screen Shot
2D Sprite Movement With Matrices (3D?) Download Code Screen Shot
Understanding the World Matrix Download Code Screen Shot

2D Collision Detection and Response

Download Code Screen Shot
     
     

GENERAL TUTORIALS

Rendering Text Download Code Screen Shot
Using a Performance Timer Download Code Screen Shot
Using Inline Assembly And The FPU Download Code Screen Shot
Using Vector Unit 0 In MACRO Mode Download Code Screen Shot
Using Audio Under PS2 Linux Download Code  
Capturing The Screen To A File Download Code Screen Shot
     
     

3 DIMENSIONAL GRAPHICS TUTORIALS

Introducing The 3rd Dimension    
Viewing In 3 Dimensions    
Transforming a Coloured Quad With VU1 Download Code Screen Shot
Controlling Primitive Rendering    
Back Face Culling Download Code Screen Shot
Processing UV Texture Coordinates With VU1 Download Code Screen Shot

Perspective Correct Texture Mapping (STQ)

Download Code Screen Shot
Render Cube With STQ, Colour, Position Download Code Screen Shot
Cube With User Controlled Movement Download Code Screen Shot
Cube With Frustum Clipping Download Code Screen Shot
One Simple Directional Light & Ambient Light Download Code Screen Shot
Rendering Many Textured, Lit, Clipped Cubes Download Code Screen Shot
Moving the Camera Around Download Code Screen Shot
Ambient Light and 3 Directional Coloured lights Download Code Screen Shot
Drawing 3D World and Local Axes Download Code Screen Shot
Setting-Up Quad Buffers in VU Data Memory Download Code Screen Shot
Creating a Point Light Source Download Code Screen Shot
Creating Lighting with Specular Highlights Download Code Screen Shot
Rendering a 3D model Download Code Screen Shot
Rotating with Quaternions Download Code Screen Shot
Uploading VU Programs During Run-Time Download Code Screen Shot
     

APPLICATION FRAMEWORKS

Game Framework Template Download Code Screen Shot
3D Graphics API for PS2 Linux Download Code Screen Shot
Audio Application Framework Download Code  
     

NETWORK GAMING WITH SOCKETS

Remote Camera Control Using UDP Download Code Screen Shot
Network Car Control Download Code Screen Shot
     

TECHNICAL DEMOS

Simple Racing Car Demo Download Code Screen Shot

AI Spline Based Racing Car Demo

Download Code Screen Shot
Dual View With Split Screen Download Code Screen Shot
Creating a Sky Box Download Code Screen Shot
     

 

 

(These tutorials and accompanying program code are used at your own risk. The author accepts no responsibility for any damage caused by running these programs.)

 

(The old site can be found here )

 

 

Dr Henry S Fortuna

University of Abertay Dundee

h.s.fortuna@abertay.ac.uk