Ps2 programming help

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
simon66
Posts: 4
Joined: Fri Jan 22, 2010 10:22 am

Ps2 programming help

Post by simon66 »

I wanted to know were can I get a ussefull tutorial in how to program for PS2. I have searched so many websites and none of them gave me a good understading. I dont have a ps2 but I have a PS3, can I install ps2 linux on PS3? Or can I program with Windows 7? If so plz tell me were can I download or the name of the file I should download cuz I cant find anywere.

Thanks

Simon
dlanor
Posts: 258
Joined: Thu Oct 28, 2004 6:28 pm
Location: Stockholm, Sweden

Re: Ps2 programming help

Post by dlanor »

simon66 wrote:I wanted to know were can I get a ussefull tutorial in how to program for PS2. I have searched so many websites and none of them gave me a good understading. I dont have a ps2 but I have a PS3, can I install ps2 linux on PS3? Or can I program with Windows 7? If so plz tell me were can I download or the name of the file I should download cuz I cant find anywere.
PS2 Linux is not an ideal development system for PS2 homebrew software or PS2 commercial games, since it is normally set up to produce code that will run ONLY under PS2 Linux, which has runtime libs different both from those of normal PS2 homebrew programs and from those of commercial PS2 games.

Development setups for commercial games are covered by Sony patents, copyrights, and non-disclosure agreements, so any copies of that stuff circulating on the Internet is highly illegal, and will not be handled here.

Development setups for normal PS2 homebrews are readily availablle here, but may be a bit tricky to install in a Windows 7 environment, as they rely on some packages intended to provide Windows XP with a linux-like environment and tool set. These packages may not work the same way with Windows 7, which is likely to mess things up... (I never even tried it myself, but I take it for granted that some things would foul up in the newer OS.)

But if you have a good and fast computer (as you should to even consider using a recent Windows version), then you may have better success installing a PS2Dev setup on a virtual machine using VMware or a similar emulator, allowing you to run Windows XP on a virtual machine. Then there are several packages around which are guaranteed to work well, including one that I prepared myself recently, which is available at: this 4shared subdomain page.

As for learning how to program the PS2 well, that is likely to be a task both long and arduous...

The main programming languages for this platform, like many others, is C and C++. But many of the really advanced projects also require some parts to be written in hand-optimized MIPS assembly code. But any studying you do of generic C programming is likely to help for programming in any other language too. Some function names or calling conventions may differ, but the basic principles of how to approach and solve problems are quite generic for all languages.

Best regards: dlanor
simon66
Posts: 4
Joined: Fri Jan 22, 2010 10:22 am

Re: Ps2 programming help

Post by simon66 »

dlanor wrote:
simon66 wrote:I wanted to know were can I get a ussefull tutorial in how to program for PS2. I have searched so many websites and none of them gave me a good understading. I dont have a ps2 but I have a PS3, can I install ps2 linux on PS3? Or can I program with Windows 7? If so plz tell me were can I download or the name of the file I should download cuz I cant find anywere.
PS2 Linux is not an ideal development system for PS2 homebrew software or PS2 commercial games, since it is normally set up to produce code that will run ONLY under PS2 Linux, which has runtime libs different both from those of normal PS2 homebrew programs and from those of commercial PS2 games.

Development setups for commercial games are covered by Sony patents, copyrights, and non-disclosure agreements, so any copies of that stuff circulating on the Internet is highly illegal, and will not be handled here.

Development setups for normal PS2 homebrews are readily availablle here, but may be a bit tricky to install in a Windows 7 environment, as they rely on some packages intended to provide Windows XP with a linux-like environment and tool set. These packages may not work the same way with Windows 7, which is likely to mess things up... (I never even tried it myself, but I take it for granted that some things would foul up in the newer OS.)

But if you have a good and fast computer (as you should to even consider using a recent Windows version), then you may have better success installing a PS2Dev setup on a virtual machine using VMware or a similar emulator, allowing you to run Windows XP on a virtual machine. Then there are several packages around which are guaranteed to work well, including one that I prepared myself recently, which is available at: this 4shared subdomain page.

As for learning how to program the PS2 well, that is likely to be a task both long and arduous...

The main programming languages for this platform, like many others, is C and C++. But many of the really advanced projects also require some parts to be written in hand-optimized MIPS assembly code. But any studying you do of generic C programming is likely to help for programming in any other language too. Some function names or calling conventions may differ, but the basic principles of how to approach and solve problems are quite generic for all languages.

Best regards: dlanor
thank you. So if I want to create a homebrew game for PS2 I dont need to use linux since its something wai different right? I still abit confused, I was told that I need to use linux to make ps2 games. BTW I know C and C++

Again,
Thank for your help
Ozqi
Posts: 4
Joined: Sat Jan 23, 2010 9:10 am
Location: Sweden

Post by Ozqi »

http://ps2dev.org/ps2/Tutorials

Follow step 2 and 3.

I'm on Windows 7 and it works just fine after I compiled the toolchain myself instead of just downloading binaries. Took my computer about 1-2 hours to compile (intel core 2 duo 3.16ghz, 8GB RAM).

Make sure to follow any instructions that are specific for Vista, even if you're on Windows 7.
protomank
Posts: 59
Joined: Thu Dec 18, 2008 1:41 am
Location: Porto Alegre, RS, Brazil
Contact:

Post by protomank »

If you want to code multi-platform games, I suggest you to learn SDL, a kind of directx for multiple systems (www.libsdl.org).
You can port a SDL app to PS2 without *much* problems (there are some tricks such as a maximum of 4 file handlers open at same time).

SDL can be used to port your game to Windows, Linux, Mac, Playstation 2, Playstation 3, iPhone, Android phones, Nintendo DS, PSP and others.

It is an easy and cool library to work with.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

protomank wrote:If you want to code multi-platform games, I suggest you to learn SDL, a kind of directx for multiple systems (www.libsdl.org).
You can port a SDL app to PS2 without *much* problems (there are some tricks such as a maximum of 4 file handlers open at same time).

SDL can be used to port your game to Windows, Linux, Mac, Playstation 2, Playstation 3, iPhone, Android phones, Nintendo DS, PSP and others.

It is an easy and cool library to work with.
I remember some time ago I had some problems with thread support, I believe it wasn't changed from then.

Also, there are serious troubles with SDL_mixer probabily due to the cooperative multitasking of PS2 not being correctly handled. I'm not "old enough" to know if SDL_mixer ever worked, but currently, it doesn't (no sound, needs proper task switching I believe). I didn't had the pacience figure out its real problems due to lack of decent debugging tools for ps2sdk and so I managed to build my own sound mixer (search for cosMix on googlecode) which I made the API to be SDL_mixer compatible.

@protomank,
Still lack of free time to post your fixes to SDL?
protomank
Posts: 59
Joined: Thu Dec 18, 2008 1:41 am
Location: Porto Alegre, RS, Brazil
Contact:

Post by protomank »

Yes, SDL have several problems, but I still not hit those, as sound is one of the last things I usually implement :)

Well remembered, once I finish the beta 3 of Rockbot, I'll find a free time to check out SDL from SVN.
simon66
Posts: 4
Joined: Fri Jan 22, 2010 10:22 am

Post by simon66 »

Ozqi wrote:http://ps2dev.org/ps2/Tutorials

Follow step 2 and 3.

I'm on Windows 7 and it works just fine after I compiled the toolchain myself instead of just downloading binaries. Took my computer about 1-2 hours to compile (intel core 2 duo 3.16ghz, 8GB RAM).

Make sure to follow any instructions that are specific for Vista, even if you're on Windows 7.
I get an error when I try to run the toolchain when I type

Code: Select all

sh toolchain.sh
I get this error

Code: Select all

../depends/check-patch.sh: /bin/patch: Permission denied
ERROR: Install patch before continuing.
../depends/check-patch.sh: Failed
then it quits.. what should I do?
Ozqi
Posts: 4
Joined: Sat Jan 23, 2010 9:10 am
Location: Sweden

Post by Ozqi »

simon66 wrote:
Ozqi wrote:http://ps2dev.org/ps2/Tutorials

Follow step 2 and 3.

I'm on Windows 7 and it works just fine after I compiled the toolchain myself instead of just downloading binaries. Took my computer about 1-2 hours to compile (intel core 2 duo 3.16ghz, 8GB RAM).

Make sure to follow any instructions that are specific for Vista, even if you're on Windows 7.
I get an error when I try to run the toolchain when I type

Code: Select all

sh toolchain.sh
I get this error

Code: Select all

../depends/check-patch.sh: /bin/patch: Permission denied
ERROR: Install patch before continuing.
../depends/check-patch.sh: Failed
then it quits.. what should I do?
I'm quite the unix n00b (which is the type of environment that msys and mingw provides) but I'm guessing you should type: sudo sh toolchain.sh

If that doesn't work, look up how to use the command chmod to recursively give proper access to all folders within a folder and type: chmod XXX /bin
Where XXX is whatever command you should use for that kind of operation. This is just my best guess, though.
Post Reply