forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Ps2 programming help

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
simon66



Joined: 22 Jan 2010
Posts: 4

PostPosted: Sat Jan 23, 2010 9:02 am    Post subject: Ps2 programming help Reply with quote

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
Back to top
View user's profile Send private message
dlanor



Joined: 28 Oct 2004
Posts: 269
Location: Stockholm, Sweden

PostPosted: Sun Jan 24, 2010 12:28 pm    Post subject: Re: Ps2 programming help Reply with quote

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
Back to top
View user's profile Send private message
simon66



Joined: 22 Jan 2010
Posts: 4

PostPosted: Mon Jan 25, 2010 1:20 am    Post subject: Re: Ps2 programming help Reply with quote

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
Back to top
View user's profile Send private message
Ozqi



Joined: 23 Jan 2010
Posts: 4
Location: Sweden

PostPosted: Mon Jan 25, 2010 5:56 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
protomank



Joined: 18 Dec 2008
Posts: 64
Location: Porto Alegre, RS, Brazil

PostPosted: Mon Jan 25, 2010 9:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Tue Jan 26, 2010 12:42 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
protomank



Joined: 18 Dec 2008
Posts: 64
Location: Porto Alegre, RS, Brazil

PostPosted: Tue Jan 26, 2010 1:38 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
simon66



Joined: 22 Jan 2010
Posts: 4

PostPosted: Tue Jan 26, 2010 1:45 am    Post subject: Reply with quote

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:
sh toolchain.sh


I get this error

Code:
../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?
Back to top
View user's profile Send private message
Ozqi



Joined: 23 Jan 2010
Posts: 4
Location: Sweden

PostPosted: Tue Jan 26, 2010 5:45 pm    Post subject: Reply with quote

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:
sh toolchain.sh


I get this error

Code:
../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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group