Solved

Programming Playstation 2

Posted on 2003-11-28
9
48,489 Views
Last Modified: 2013-12-26
Hi!

I would like to learn programming for playstation 2.
I'm not aiming for some high quality games, but some simple projects, just to impress my friends. :)

I did a google search and have found many pages concerning PS2 programming, but I still haven't found what I need.

I would like to have some Development environment which I would install on my PC, write a programm with it, and then burn a CD which will work on PS2 platform.
I wasn't able to find it anywhere.
There are few tools and developer environments that are used with PC (like Cygwin, PS2DEV), but all of them use USB cable to upload a game to PS2, and I would like to burn a CD instead.

I assume that once I compile a programm in souch tool, that it shouldn't be too hard to make a CD, but it realy suprized me when I realized that everyone is using Cable, and noone
bothered to explain how to create a working CD.   (  I know that testing a program is much less painfull when using cable, but if I plan to use this program in future it has to be on a CD)

1) So I would like to know how to burn a CD so it will work on PS2.
2) What are some common file names or file extensions that PS2 platform uses.  (  For example. In windows EXE means executable, BMP means bitmap etc.)
3) What method does PS2 use to load a CD.    (  For example.   Windows use autorun.inf to read which file has to be oppened first )
          - Does PS2 require some boot sector on a CD in order to load it properly or is there some common file that is loaded first  (  like autorun.inf ? )

If there is anyone that had some experience in programming PS2, please respond.
It would be great if someone could give me some simple (working) code, and a step by step guidance on how to compile this code to a working program on CD.

P.S. I already have about 7 years of programming experience in many languages, and OS's for PC based platform and now I'd like to use this knowledge on new platform, but I need some basic guidance.

Thanx in advance! ( I probbably won't be on-line through the following weekend so if anyone posts something, expect me to reply on monday)
0
Comment
Question by:dbrckovi
9 Comments
 
LVL 2

Expert Comment

by:mingz
Comment Utility
Hi there, I am also very intersted in programming games on ps2. But I am still learnning to do that on a ps2. You can get many information on ps2 here:
http://www.megagames.com/ps2/ps2_guides_files.shtml

hope it may help :)

0
 

Expert Comment

by:Datsme
Comment Utility
You can try this page, it has some tutorials, example programs  and sample loaders

http://ps2dev.org/
0
 
LVL 1

Accepted Solution

by:
nonovex earned 400 total points
Comment Utility

Hi dbrckovi, sorry for answering so late :)

for ps2 homebrew development you will have two parts, the first, programming and debugging (unless you don't have any error ;) ) and the second one, creating the final CD.


right now the best choice for the first part (the one you'll spend more time) is using a broadband adapter, Pukklink, and inlink:

The broadband adapter is the ps2 device which allows you to play great online games.  

Pukklink is a PS2 CD which you have to burn and boot in the playstation 2, to be able to send files to the playstation 2. You can find it here:   http://ps2dev.org/files/pukklink_v1.0b.rar
Of course you must have a modded PS2 so that you can boot backup CDRs. anyway you need it if you want to boot your final CD :)

Inlink is the PC server you use to send files. You can also read files from your host PC so no need to burn CDs for testing :)  http://inpulse.planet-d.net/toolz.php


once there you only need a r5900 compiler like gcc, which you can easily find here: http://www.thethirdcreation.net/tools/ps2DevEnvironment.exe  
The installation is quite straightforward.

Once installed you should have a PS2 environment link in your desktop, or your autoexec modified (can't remember it). You might need extra libraries, depending on what you want to do. Just look at ps2dev.org for more info. PS2LIB is the de facto standar for ps2 homebrew. There's a ps2lib with the gcc distribution however you can grab a newer version at ps2dev.org

just grab your favourite editor and write this:

#include <kernel.h>
#include <sifrpc.h>

int main (void)
{
      SifInitRpc (0);
      init_scr();
      scr_printf ("PS2 roolz!");
      SleepThread (();
      return 1;
}

compile it with...

ee-gcc main.cpp -c -o main.o -Ic:/ps2dev/ps2lib/ee/include/
ee-gcc main.o -Tlinkfile -o ps2.elf -Lc:/ps2dev/ps2lib/ee/lib -lgcc -lkernel -lmc -lpad

(note: I've used "my" standar files, my standar paths, and libraries, just use your path, and there's no need for -lmc nor -lpad, but it stands as an example. The standar linkfile is somewhere in the compiler tree, in a directory named startup)

you should have a ps2.elf now. Just upload it via inlink&pukklink, or the USB cable, and it should execute on your ps2 :)



now for the CD. To make a ps2 cd bootable (NOT a DVD) you just need to
burn the correct files there, no need for special headers. Of course you
must have a modded ps2 so that she can boot backup CDRs.
The autorun.inf equivalent for the PS2 is SYSTEM.CNF (you can see it in all
the games for PSX and PS2). There you just specify the file to boot
and voila.

i.e. my pukklink cd has something like this:
BOOT2 = cdrom0:\PUKKLINK.ELF;1
VER = 1.10
VMODE = NTSC

of course, the exe name is PUKKLINK.ELF

beware when burning CDs, if you just forget a file you'll have to start again ;)
BTW, CDs must be CD Mode 2 / XA . PSX cds had to have at least 3 minutes track of music at the end of the CD, otherwise some weird things happened with the CD. I think PS2 doesn't have this problem but I do it too as I'm used to.


.ELF files in ps2 are used to be standar EXEs, .IRX files use to be IOP processor executable files (or drivers). however as you know, they're just that, names, and everybody can give them the name they want as you can name the .BMP as .XYZ and setup the file explorer to launch the paint program with them   ;)



ps. I wrote this by memory, except links and source code. There might be some mistakes but I think it's quite accurate. I hope it helps :)


-------
This is your world now.
Sir Auron
0
 
LVL 11

Author Comment

by:dbrckovi
Comment Utility
Thanx to all and specialy to nonovex for detailed answer. I'll try what you suggested, and decide what to do when I get some results.

BTW ... Can PS2 boot a CD-RW and/or boot from small CD-RWs? ( That small 185 MB things, for which I can't find the right word in English, that can be inserted in every CD device same as normal CD's )

It seems much easier to rewrite the CD then to move my PS2 and a TV set to another room in order to connect it to a computer.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 11

Author Comment

by:dbrckovi
Comment Utility
nonovex

I downloaded PS2Dev Environment from the location you specified. I installed it under        d:\davor\PS2Dev

I created test.cpp with your example   ( removed that extra bracked ) and compiled to test.o without any problems. But I can't link it to PS2.ELF


This is the line I used at command prompt:                  ee-gcc test.o -Tlinkfile -o ps2.elf -Ld:/davor/ps2dev/ps2lib/ee/startup -lgcc -lkernel -lmc -lpad

And this is the error message I get:                             d:\Davor\ps2dev\GCC\ee\bin/../lib/gcc-lib/mips64r5900-sce-elf/2.9-ee-991111b/../
                                                                                ../../../mips64r5900-sce-elf/bin/ld: cannot open crt0.o: No such file or directory
                                                                                collect2: ld returned 1 exit status

I have tried experimenting with or without -lmc -lpad and other parameters but I allways get the same message.    

I have the crt0.o file located under       D:\Davor\ps2dev\ps2lib\ee\startup

What went wrong?
0
 
LVL 11

Author Comment

by:dbrckovi
Comment Utility
I copied files from startup directory to my project dir. and it found crt0.o,     but now I get the same message, but saying that it can't find -lkernel

How did you setup your PS2Dev environment when you first got it?

I tried reading Tutorials and Docs on PS2Dev.org, but none of them is written for http://www.thethirdcreation.net/tools/ps2DevEnvironment.exe,     or I just can't connect them together.

If I understood it right, all tutorials on ps2dev.org are describing how to install and configure Ps2Dev Environment from scratch, and the file you directed me to, already has all of this installed and configured.

Where is some help or tutorial for the environment that I downloaded?    www.thethirdcreation.net only contains some basic info for some competition on developing for PS2.

Basicaly Im lost. Please help.
0
 
LVL 1

Expert Comment

by:nonovex
Comment Utility
no idea about the small CDRW, sorry :(

the crt0.o also gave me problems at the start, my solution was copying it to my local directory and add it to the compilation line (i.e. ee-gcc mymain.o crt0.o -o ps2.elf .....  ).  

if problems with not found libs, you should add something like
 -Lc:/ps2dev/ps2lib/ee/lib (or probably  -Ld:/davor/ps2dev/ps2lib/ee/lib ni your case) to say gcc you have them in that directory.
 BTW, beware with DOS commandline: It only accepts 128 characters so you'd better be working with makefiles and the supplied make.exe at d:/davor/ps2dev/gcc/share , otherwise you might run into some problems of typing the whole line but the gcc just obeying the first 128 chars.

however, are you doing c++ or just c? c++ usually gives some headaches when configuring everything. If you're with c++ I'd swap to c temporally before having everything set up correctly, to move then to c++

I also haven't found information for the precompiled package from thethirdcreation, but I found it a lot easier than the 'from the scratch' installation packages. I'm not suited for gcc headaches :)

I hope it helps! :)
0
 
LVL 11

Author Comment

by:dbrckovi
Comment Utility
I'll only programm in raw C style. I don't like thoose objects anyway. :)

BTW. I can't test what you said, becouse I had some problems with my disk, so I'll have to reinstall everything. I'll come back when I set it up again.
0
 
LVL 11

Author Comment

by:dbrckovi
Comment Utility
I'm having some serious problems with my comp so I won't be able to test this for some time.

In the meanwhile I'll accept your answer becouse it answered my question perfectly, and there's only details to iron out. But i'll deal with this later.

Thanks again for answers.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

NOTE: I, EE, or Sony, take no responsibly if this harms your system. Sony does not recommend doing the fan test for ordinary users, but I have not heard of any damage being done to your system after doing this. Attempt at own risk.Hi! In this art…
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now