Doom - PS2 Port

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

Moderators: cheriff, Herben

LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

I'd love to compile a copy (mostly for educational purposes), but I'm having trouble with SDL. I can grab SDL from the SVN repository (there I don't know if it's important where exactly I store it), but I'm at a loss as to what to do next. Should I compile or install SDL? Should I simply place the SDL include directory in a path according to the source of whatever SDL project I'm trying to compile? Do I (as I've seen mentioned in a very old thread) need to install gsKit first?

A little help would go a long way. I hope I don't sound like I want someone to hold my hand; it's just difficult to find much info...
I may be lazy, but I can...zzzZZZzzzZZZzzz...
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

LBGSHI wrote:I'd love to compile a copy (mostly for educational purposes), but I'm having trouble with SDL. I can grab SDL from the SVN repository (there I don't know if it's important where exactly I store it), but I'm at a loss as to what to do next. Should I compile or install SDL? Should I simply place the SDL include directory in a path according to the source of whatever SDL project I'm trying to compile? Do I (as I've seen mentioned in a very old thread) need to install gsKit first?

A little help would go a long way. I hope I don't sound like I want someone to hold my hand; it's just difficult to find much info...
You need to install gsKit before SDL, as SDL requires it for graphics.

Assuming you already have PS2SDK installed, the following will checkout gsKit and SDL from subversion, as well as build and install.

Code: Select all

svn co svn://svn.ps2dev.org/ps2/trunk/gsKit
cd gsKit
make all install
cd ..
svn co svn://svn.ps2dev.org/ps2/trunk/ps2sdk-ports/sdl
cd sdl
make all install
cd ..
This will install SDL into $PS2SDK/ports.

I dont think these things are documented anywhere, for the most part I just look in Makefiles and source code to figure out how things work :-)
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

Thanks very much.
I dont think these things are documented anywhere, for the most part I just look in Makefiles and source code to figure out how things work :-)
I've done much of the same myself (though I'm still learning), and though the lessons learned in doing so have been useful, I think it would have been more useful if I'd spent that time writing functioning code :)

It's for that reason that I'd like to write some really good documentation for many things involving PS2Dev.

Anyway, I checked out and installed both gsKit and SDL, which seemed to have worked fine, but I'm still getting this error on attempted make of the Doom source you have hosted on Lukasz.dk:

Code: Select all


i_main.c:28:17: SDL.h: No such file or directory
make: *** [i_main.o] Error 1

...which is referencing the line stating #include "SDL.h" in i_main.c. Doesn't including a file with quotation marks usually imply the file should be in the same directory? I do know that with classic ANSI C, it would next check the usr/include dir, but is there another place "SDL.h" should be found? Or, shall I just jam a copy of the file into the source directory of PS2Doom?
I may be lazy, but I can...zzzZZZzzzZZZzzz...
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

If you read the included README.PS2, you would see that you need to use Makefile.ps2 to compile the source.

Code: Select all

make -f Makefile.ps2
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

Ack, my apologies. Unfortunately this resulted in:

am_map.o: file not recognized: File format not recognized
make: *** [doom.elf] Error 1

After sniffing around a bit in am_map.c, I can't imagine what the issue is...

In any case, sorry to be such a bother, and I do greatly appreciate the help.
I may be lazy, but I can...zzzZZZzzzZZZzzz...
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

The problem is that you have already compiled am_map.c into a x86 am_map.o object. So you need to delete it and compile it for PS2. You can do this with

Code: Select all

make -f Makefile.ps2 clean all
This command will remove all the objects files and compile the source for PS2.
LBGSHI
Posts: 136
Joined: Mon Aug 07, 2006 5:56 am
Contact:

Post by LBGSHI »

Awesome; thanks! That worked perfectly.
I may be lazy, but I can...zzzZZZzzzZZZzzz...
dirsors
Posts: 13
Joined: Tue Mar 04, 2008 1:21 pm
Location: Porto Alegre, RS, Brazil

Post by dirsors »

Any news, updates, new releases or updates for this port?
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

dirsors wrote:Any news, updates, new releases or updates for this port?
Yes and no... Updates only on an indirect way. I've been exploring how to do basic debugging on the PS2 since with little free time and no basic debugging I'll not go far. But keep tuned to my blog (see above) since any new announcements will be made there instead of here, since ps2dev forums were made ideally for discussing development.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

I've been including the sound routines from prboom+ into Lukasz port and also tried to incorporate Jason's but I only get garbled sound in particular conditions and silence is normal conditions... Let me explain:

After replacing sound routines from prboom+ sources I got only silence. But
when I was debugging it by inserting some printf, suddenly I've got some weird chopping sound - the thing is if I don't do any printf I'll would get only silence! I checked also that the sounds samples being fed to the SDLmixer engine are OK by inspecting the samples sent under debugging prboom+.

I was surprised when I also got no sound from replacing the sound routines from the working Jason's... But I must admit I must do some more checking for this last one. But again, it happened again the same when I did some printf.

Is there something fishy with the SDL_mixer PS2 port? Some kind of thread issues?

Yesterday I was also surprised after looking at the code for PS2 Pang and saw some 'printf("");' statements before and after the SDL mixer Mix_PlayChannel function... This is no coincidence :) And if I remove those printf, I get silence has well.

Unfortunably, weird sound is only what I can get currently with the printf trick, not regular and perfect Doom sounds as in Jason's port.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

My experience working with the SDL on the Doom port tells me that SDL is by no means complete nor properly tested.

I also briefly tried to make sound work, but the sound support in SDL appears to be far from complete. Jason Yu also confirms this in his post in this thread.

I would personally expect to do some heavy debugging and developing on SDL itself while porting a SDL application to the PS2. Which is also why I had no interest in continuing work on the Doom port :-)
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

cosmito wrote:Accodingly to the authors of the USB driver, the write operations weren't enough tested, so there's the risk of data corruption. I may add support to save to USB, but in any way I will be resposible for any data loss...
Sometimes I get amazed myself with the rubish I sometimes write :) Indeed I read that from the documentation but I guess the USB drivers are tested enough nowadays :)
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

Lukasz wrote:My experience working with the SDL on the Doom port tells me that SDL is by no means complete nor properly tested.
(...)
I would personally expect to do some heavy debugging and developing on SDL itself while porting a SDL application to the PS2. Which is also why I had no interest in continuing work on the Doom port :-)
Yes, debugging SDL is no appealing to me much. Without decent debugging tools it can be a very time consuming task.

So I see two paths :

- Debug it more, specially the inclusing of Jason sound functions into your port (damn, it should work!)

- Forget about SDL_mixer regarding sound and start to use other sound library. SjPCM may be a candidate.
dirsors
Posts: 13
Joined: Tue Mar 04, 2008 1:21 pm
Location: Porto Alegre, RS, Brazil

Post by dirsors »

Also,
You should know that Doom music is in MIDI format. The question is: how could the PS2 play Doom music? Is there a "midi synthesizer" on PS2 hardware?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Actually, DOOM's music is in MUS format. Most DOOM ports convert the MUS score into a MIDI score, then play that with timidity. My own port (for the PSP) actually plays the MUS score directly.
theli
Posts: 1
Joined: Fri Nov 14, 2008 7:59 pm
Location: Ukraine,Kyiv
Contact:

Post by theli »

why bother with sdl for doom port?
dirsors
Posts: 13
Joined: Tue Mar 04, 2008 1:21 pm
Location: Porto Alegre, RS, Brazil

Post by dirsors »

And why the DOOM_no_sound.ELF only loads from USB mass storage device? What's necessary to be HDD (uLaunchelf) compatible?

ps2hdd.irx not loaded?
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

dirsors wrote:And why the DOOM_no_sound.ELF only loads from USB mass storage device? What's necessary to be HDD (uLaunchelf) compatible?
ps2hdd.irx not loaded?
Hi,
Well it's necessary to add code to it for HD support.

Currently I'm busy building a sound mixer from scratch so I can replace SDL_mixer from it.
I could add HD support later, not for now. It should be quite simple.

If anyone want to collaborate adding it now, fetch the sources from
http://svn2.assembla.com/svn/pedroduarteps2dev_public/
and be my guest :)
User avatar
kouky
Posts: 48
Joined: Tue Sep 25, 2007 5:38 am
Location: London
Contact:

Post by kouky »

Cosmito, I would like to know how you force PAL signal in your Doom port.
You didn't explain how you mad it and unfortunately your Doom source file does no longer exists.

Sharing your PAL fix would be very helpful :)
softwares for artists on video game systems - http://www.pikilipita.com
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

kouky wrote:Cosmito, I would like to know how you force PAL signal in your Doom port.
Hi,
Just to be fair to the authors, it's not my port. 99,9% of the hard work was made by Lukasz and Jason (I'm experimenting with the two ports).

LOL! I was going to say that I'm not forcing PAL nor NTSC since I forgot I added an option to do it :) Well, my memory is funny sometimes.

Both ports use SDL which by his turn uses gsKit. There is a SDL function (PS2SDL_ForceSignal) which tells later PS2_VideoInit to open a PAL or NTSC screen by calling gsKit_init_global.
kouky wrote:You didn't explain how you mad it and unfortunately your Doom source file does no longer exists.

Sharing your PAL fix would be very helpful :)
Hmmm are you searching at the right places? Please look here :
http://svn2.assembla.com/svn/pedroduart ... ldoom_PS2/

My "force" call is at l_main.c line 438. Basically I check of the main() args to get the ELF file name, so adding PAL or NTSC at the end of the filename (not the extension of course) triggers the override trick.
dirsors
Posts: 13
Joined: Tue Mar 04, 2008 1:21 pm
Location: Porto Alegre, RS, Brazil

Post by dirsors »

I'm trying to compile lsdldoom-v005nosound.
It requires ROMFS, so I got the romfs from the svn repository.

When I tape 'make all install', it shows:

Code: Select all

$ make all install
make -C tools/genromfs all
make[1]: Entering directory `/home/usr/ps2sdk-ports/romfs/tools/genromfs'
gcc -O2 -Wall    -c -o genromfs.o genromfs.c
genromfs.c:78:24: netinet/in.h: No such file or directory
genromfs.c:80:28: sys/sysmacros.h: No such file or directory
genromfs.c: In function `romfs_checksum':
genromfs.c:233: warning: implicit declaration of function `htonl'
genromfs.c: In function `fixsum':
genromfs.c:242: warning: implicit declaration of function `ntohl'
genromfs.c: In function `dumpnode':
genromfs.c:349: warning: implicit declaration of function `S_ISLNK'
genromfs.c:353: warning: implicit declaration of function `readlink'
genromfs.c:386: warning: implicit declaration of function `major'
genromfs.c:386: warning: implicit declaration of function `minor'
genromfs.c:395: warning: implicit declaration of function `S_ISSOCK'
genromfs.c: In function `processdir':
genromfs.c:546: warning: implicit declaration of function `lstat'
make[1]: *** [genromfs.o] Error 1
make[1]: Leaving directory `/home/usr/ps2sdk-ports/romfs/tools/genromfs'
make: *** [all] Error 2
$
I'm using MSYS. What can I do?
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

LBGSHI already reported that issue... It seems a MinGW issue, I'm afraid. With cygwin romfs compiles perfectly.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

I (finally) fixed sound for Lukasz's PS2Doom port. I implemented my own mixer engine and got rid of SDLmixer calls.

Get it from :
http://ps2homebrewing.wordpress.com/200 ... d-at-last/
mazxim
Posts: 23
Joined: Thu Jan 24, 2008 12:29 am
Contact:

Post by mazxim »

Thank you!

I'm glad to see good coders having fun while tribute historical masterpiece games. I'm gonna try it soon.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

cosmito wrote:I (finally) fixed sound for Lukasz's PS2Doom port. I implemented my own mixer engine and got rid of SDLmixer calls.

Get it from :
http://ps2homebrewing.wordpress.com/200 ... d-at-last/
Your RabidSwear link gives an error.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

The link is now fixed (I'm using 4shared service).

BTW: It's still not impremented yet in this port the changes I made to lsdldoom (adding support for next/prev weapon, game save/load to memory card) but I'll add soon of course.
Last edited by cosmito on Sat Feb 28, 2009 9:35 pm, edited 1 time in total.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

Great job on adding sound support Cosmito! I've updated my original Doom post at my website, linking to your website for further updates on the port. Keep up the good work.
protomank
Posts: 59
Joined: Thu Dec 18, 2008 1:41 am
Location: Porto Alegre, RS, Brazil
Contact:

Post by protomank »

Question, why not you guys fix SDL Mixer instead of creating a new sound system?
While it is good for doom, if SDL Mixer worked well, more people would benefit.

Just my 2 cents.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

Personally I've found more appealing and even educational for me to write a sound mixer instead of debugging/fixing others people code.

But yes, I see your point. I believe the problem with SDLmixer is a side effect of PS2 cooperative multitasking. The sound playing task seems to be freezed all the time. So this is a hint for anyone willing to dig into it.

Maybe a simple thread switching solution would do the trick, like the one EEUG points over :
http://forums.ps2dev.org/viewtopic.php?t=10294
protomank
Posts: 59
Joined: Thu Dec 18, 2008 1:41 am
Location: Porto Alegre, RS, Brazil
Contact:

Post by protomank »

Thnaks for the information, I'll try to take a look once I got a bit better into PS2 development and have a free time.
Anyway ps2 doom is great, keep the good work :D
Post Reply