PS2 PS2Doom Compiles but do not work.

Adilson

Forum Noob
Hi,
I've sucessfuly instaled the PS2DEV toolchain on CentOS and cloned the ps2doom port from https://github.com/lukaszdk/ps2doom. The code compiles with sucess but running at PS2 with PS2Link and InLink, the game crashes at initialization. The error log returns me the following:

read/write allocate memory 4000
open name doom2f.wad flag 1 data 41378
Unknown device 'doom2f.wad'
open fd = -19
open name doom2.wad flag 1 data 41378
Unknown device 'doom2.wad'
open fd = -19
open name plutonia.wad flag 1 data 41378
Unknown device 'plutonia.wad'
open fd = -19
open name tnt.wad flag 1 data 41378
Unknown device 'tnt.wad'
open fd = -19
open name doomu.wad flag 1 data 41378
Unknown device 'doomu.wad'
open fd = -19
open name doom.wad flag 1 data 41378
Unknown device 'doom.wad'
open fd = -19
open name doom1.wad flag 1 data 41378
Unknown device 'doom1.wad'
open fd = -19
Game mode indeterminate.

I think that this is some problem with the I/O code (d_main.c and w_wad.c source files), that cannot open the host looking for doom wads.

The curious thing is that the provided file doom.elf at the ps2doom-bin.zip package runs it without any error! The game can be played.

Anyone can help me fixing this problem? Once it is fixed, I'll create a Pull Request on GitHub.
Thanks a lot.
 
I'm not sure if I can help you...
but maybe org files from here might be useful:

There is also Chocolate Doom.
Currently available for PS Vita:
https://wololo.net/talk/viewtopic.php?t=48973,
https://github.com/fgsfdsfgs/chocolate-doom.
It supports Doom, Doom II, Final Doom, FreeDoom, Chex Quest, Heretic, Hexen and Strife.
Original repo:
https://github.com/chocolate-doom/chocolate-doom.

 
Last edited:
  • Like
Reactions: TnA
The problem is the actual ps2toolchain. The IO files functions like fopen, fclose, etc, doesn't work anymore like before. I need to know the new functions and libs and change the source code.
 
fopen etc work fine with current toolchain, it's fio and fileXio that aren't "supported" ... the error reads like it's not specifying a device since it's just trying to load doom2.wad etc rather than host:doom2.wad etc
 
  • Like
Reactions: TnA
Well, I've tried the following sample code just to see if it works:

FILE *pont_arq;
//opening file
pont_arq = fopen("host:somefile.txt", "a");
//closing file
fclose(pont_arq);
//message
printf("File created sucessfully");

And it returned:

open name host:somefile.txt flag 302 data 41378
Unknown device 'host'
Known devices are:
Code:
tty:(CONSOLE)  rom:(ROM/Flash)  cdrom:(CD-ROM )

Reason for editing: Added code to disable "smilies"
 
Last edited by a moderator:
  • Like
Reactions: TnA
Yes, PCSX2. I was using it just for debugging purposes.
Now I'm using PS2Link with InLink.

I renamed "doom1.wad" to "d1.wad" and editing the line 598 of d_main.c, i replaced:

"sprintf(doom1wad, "%sdoom1.wad", doomwaddir);" to

"sprintf(doom1wad, "%shost:d1.wad", doomwaddir);",

And it worked!!! The ps2doom started fine and was come back to life again ;-)

I had to rename the game wad file because it appears that "%shost:doom1.wad" was too long. The InLink console reported the following if .wad was unchanged:

[FILE] : Cannot Open doom1.w! #0
open fd = -1

I've tried to replace "1+9+1" as "doom1wad = malloc(strlen(doomwaddir)+1+12+1);" but it didn't worked.
Where can I increase the string size to the game acceppt the full .wad name? I wouldn't like to rename the wad files.
 
  • Like
Reactions: TnA
Glad you got it working but I don't think that's the right way to do it, you seem to be having an issue with doomwaddir not having a device path.. I only had a quick look at it but it seems to get the path with getenv() perhaps that doesn't function properly in newlib? No idea..

maybe try a different way of populating doomwaddir with your chosen device path.. getcwd() maybe idk just spit balling trying to head you in the right direction.
 
  • Like
Reactions: TnA
Forget it. I was able to fix all the stuff.

The problem was really with the lines "doomwad = malloc(strlen(doomwaddir)+1+8+1);". It was just a question of adding + 4 to the corresponding line, line 1+8+1 turns into 1+12+1; 1+9+1 turns 1+13+1 and go on.
Tested with all Doom wads, except the french and registered (doom.wad) versions because I don't have them, but it should work. Everything is fine now.
I'll do a pull request on the github updating the code.
Krah, thank you so much for helping me!

Next step: try to add cheat code support.
 
If you upload binary, I can test these updates with:
  • Doom
  • Doom 2
  • Final Doom: TNT Evilution
  • Final Doom: The Plutonia Experiment
  • Additionally Heretic, Hexen
GameFile(s)
Shareware Doom'doom1.wad'
Doom / Ultimate Doom'doom.wad'
Doom II'doom2.wad'
Final Doom: TNT Evilution'tnt.wad'
Final Doom: The Plutonia Experiment'plutonia.wad'
Chex Quest'chex.wad'
'chex.deh'
FreeDoom: Phase 1'freedoom.wad'
FreeDoom: Phase 2'freedoom2.wad'
FreeDM'freedm.wad'
Shareware Heretic'heretic1.wad'
Heretic / Shadow of the Serpent Riders'heretic.wad'
Hexenhexen.wad
Strifestrife1.wad
voices.wad
Source:
https://wololo.net/talk/viewtopic.php?t=48973.

What about music?
Is there a chance to also fix support fir it?
 
  • Like
Reactions: TnA
Here is the binary.
It only works with ps2link and InLink or similar.
There isn't support for Heretic or Hexen games.
About music support, that's a big problem because the PS2 doesn't have a midi synthesizer.
I will try to add cheat code support.
 

Attachments

Unfortunately my PS2 is not hooked up to PC right now, so I cannot test it.
Any chance for version without need to have ps2link...

Does this version has got some kind of a WAD selector:
select-wad.png
 
  • Like
Reactions: TnA
I have a fork where I made to work time ago!
Now after newlib, probably I needed to update.
But as I said, it was working fluid (but no sound)

Thanks

Francisco, I already adapted the code on your fork with the pull requests. The master branch is working fine!
I'm trying to work on the cosmito (duarte) branch to achieve the same result, but I'm with serious difficulties. The cosmito branch have sound support but without music.

My goal is to add cheat code support, like the PSPDoom version. Maybe someday with help from other developers.

Thanks for your support!
 
  • Like
Reactions: TnA
I would seriously hope for a merge of different ports, nit-picking the best stuff! :D

Awesome work!

If more WADs are compatible, this can emerge to something big!

Imagine "per app folders", for every WAD "out there"!
 
Th
I would seriously hope for a merge of different ports, nit-picking the best stuff! :D

Awesome work!

If more WADs are compatible, this can emerge to something big!

Imagine "per app folders", for every WAD "out there"!

That would be great, but unfortunately the PS2Doom project is suffering with a lack of interested developers to improve this source port...:frown new:
There is so much to do, like improve video resolution, music support, etc.
 
  • Like
Reactions: TnA
I honestly would say to focus your effort to understand why the RA core is not working fluid in PS2....
And this is why I started to take a look to the previous implementation of DOOM because in RetroArch it was working extremely slow....

Thanks
 
  • Like
Reactions: TnA
@Adilson No problem! Your continued efforts are interesting and maybe we can get more developers either already in the scene or "not yet", might join later on.

We have various channels to spread the word! ;)
 
I honestly would say to focus your effort to understand why the RA core is not working fluid in PS2....
And this is why I started to take a look to the previous implementation of DOOM because in RetroArch it was working extremely slow....

Thanks

Wich RA Core isn't working fluid in ps2?
 
It sounds to me, like Newlib doesn't help to append the PWD to the path, when fopen() is provided with a relative path.
 

Similar threads

Back
Top