My ps2 game in a CD

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

Moderators: cheriff, Herben

Post Reply
phenomnon
Posts: 6
Joined: Fri Jun 15, 2007 3:52 am

My ps2 game in a CD

Post by phenomnon »

Hi. I make a ps2 game using ps2sdk and pacogl (i'm sure that you don't know pacogl jejeje, it's a subset of the opengl 1.1 standard for playstation 2 developed on the computer sciences faculty of Las Palmas de Gran Canaria University, Spain.).

That's my problem: I develop, test and use my game using ps2link-ps2client. (ps2client execee host:balls.elf .... ), and it works perfectly, but I burn the .elf and the .tga textures in a mode2 cd, and I load it using swapmagic cd and the textures dont load! The game runs but the textures don't load :( the program can't find them.

What's the problem? Could I embed the textures in the .elf? or load an .irx to read the cd unit?

I read my textures with the typical instruction

Code: Select all

fopen(file, "rb")
and I use in the next values for the file variable: "data/textures/loading.tga", "host:/data/textures/loading.tga" and "cdfs:/data/textures/loading.tga". No one works :((

Any suggestion?
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

I've never heard of pacogl before, is there a homepage? (Can't find anything official on Google)

You can embed the textures in the ELF by using a tool like bin2s/bin2c/bin2o, all included in PS2SDK.

Try

Code: Select all

fopen("cdrom:\\data\textures\loading.tga", "rb");
or the relative host path

Code: Select all

fopen("host:data/textures/loading.tga", "rb");
Remember you don't have access to "host:" unless you run the ELF in a loader like PS2Link.
phenomnon
Posts: 6
Joined: Fri Jun 15, 2007 3:52 am

Post by phenomnon »

If I embed the textures in the .elf, can I access to them using fopen?

For example, fopen("loading.tga", "rb"); or fopen("data/loading.tga", "rb"); ?? I'll investigate this ;)

PacoGL have just reach a "alpha version". In 1 month or 2 we will publish the library on internet. I can tell you that a member of our Videogames Group make work Quake 2 with the library in PS2. He achieved about 5 FPS.., but the game works!

I'll post the url on this forum when the page is online. If u are interested, I can e-mail you the source code.

sorry for my english :P
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

If you wish to use fopen, you can try using romfs from the PS2SDK.

You can check lsdldoom by Jason Yu for an example of how to use it:

http://forums.ps2dev.org/viewtopic.php?p=66358#66358

I found a version of the pacogl source code on Mega Upload:

http://www.megaupload.com/?d=XAHB5TZ0

Looking forward to the official release :-)
phenomnon
Posts: 6
Joined: Fri Jun 15, 2007 3:52 am

Post by phenomnon »

That's the oldest version of pacogl, the first release. The double buffer don't work and many other bugs. The next release is much better ;). The only "but" is that the illumination (glLight, glEnable(LIGHT_0), etc.) is not implemented.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Re: My ps2 game in a CD

Post by cosmito »

phenomnon wrote:That's my problem: I develop, test and use my game using ps2link-ps2client. (ps2client execee host:balls.elf .... ), and it works perfectly, but I burn the .elf and the .tga textures in a mode2 cd, and I load it using swapmagic cd and the textures dont load! The game runs but the textures don't load :( the program can't find them.
You just need to do some initialization to be able to access the cdfs: device. Grab the source of the PGEN emulador (search inside these forums, the download link is somewhere here) and look how it's done.

I already burned a lot of media just to get it right :)

Don't forget to do the sbv_patch_enable_lmb() - it's crutial for unlock the access to cd device (and others).

Remind me next weeked for me to post a small example if you're in trouble.

Saludos
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

@phenomnon,

check PM.
phenomnon
Posts: 6
Joined: Fri Jun 15, 2007 3:52 am

Post by phenomnon »

I finally embebed all files on the ELF using romfs. Very useful tool!!!

Thank you for your replies!
Post Reply