PS2 Linux Programming
Developing With Microsoft Visual C++ .NET
Introduction
It may seem odd to develop Linux applications with
Microsoft Visual C++ .Net but this is convenient for two reasons: Firstly, the
Visual C++ environment has many features (such as syntax highlighting, class
viewing, etc.) which ease the development of code; and secondly, many people
have used and are familiar with this development environment. This tutorial
will therefore show how PS2 Linux applications can be developed using Visual
C++ .Net.
The Development Configuration
The hardware configuration used is shown in figure
1. It should be noted that there are many hardware configurations that are
possible and will work effectively.
Figure 1
The following equipment is
used: PlayStation2 with Linux kit, Windows PC, two PS2 controllers, dual input
LCD monitor, television, keyboard and mouse for the PS2 and PC. The dual input
LCD monitor is used to display the video output from either the PC or the
PlayStation2. Both the PC and the PS2 are connected to an Ethernet network to
allow communications. Output from the PlayStation2 can be directed to the
television when/if required.
Code development is
undertaken as follows. The Linux file system is made available to the PC via a
Samba server running on the PS2. Files on the PS2 are created and edited on the
PS2 using Visual Studio running remotely on the PC. From either a Telnet or SSH
session running on the PC, program code on the PS2 can be compiled and executed
with graphics output being directed to either the LCD monitor or the
television. Debug output from the program is sent via the Telnet/SSH session to
a console window on the PC. Using this configuration it is possible to direct
graphics to the television and debug information to the LCD monitor.
Creating a PS2 Linux Project with Visual C++ .Net
·
Start Visual
Studio .Net
·
Select File
-> New -> Project
·
Select a
project type of Visual C++ Projects -> Win32
·
Select a
template of Win32 Console Project
·
Enter a
suitable name for the project and select a folder that is on the PS2 file
system, then click OK
·
From the Application
settings dialogue, check the “Empty Project” box from the Additional options
list and click Finish
·
Create or add
source files to the project
·
Now start a
telnet session on the PC and connect to the PS2
·
Change to the
project directory on the PS2
·
Execute make
to compile the project
·
Execute the
application e.g. ./main
The facilities of visual studio can now be used to
develop the software. After any changes have been made to the code, save the
changes then recompile and run the application from the telnet window.
Note that this configuration allows all of the
development to be done on the PC with the PS2 being accessed remotely over the
network. If a television is available (or two monitors), all graphics can be
rendered to the television and no monitor switching is required.
Sample Application
The application code from the “Drawing Graphics”
tutorial has been converted to a Visual C++ .Net project. The project is
available for download using the “Download Code” link. The source code and Make
file has not been altered in any way. Experiment using this application to
become familiar with the development environment.
This tutorial has shown how Visual Studio .Net can
be used to create and edit applications for PS2 Linux.
Dr Henry S Fortuna