Doom PSP b6, now with music and PWADS

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
StereoMike
Posts: 5
Joined: Sun Dec 11, 2005 11:06 pm

Doom PSP b6, now with music and PWADS

Post by StereoMike »

I have been hacking away at the source of the Doom PSP port and have now got a lot of new features added to it. I'll just paste the changelog and let you all test it out. You will need atleast the shareware wad to run it.

-Music now works fine
Uses samples from the opensource freepats.opensrc.org
Needs these placed in the inst directory. This is included in the package.
The library libtimidity that is used is included with full src for others to add midi music. Just take a look i_sound.c in the doom src for an example of using it.

-Added Selection of PWAD to load in addition to the main (I)WAD.
PWADS should be put in a directory below the WAD directory
for example
PSP/GAME/DoomPSP
PSP/GAME/DoomPSP/WADS --put the main wads here
PSP/GAME/DoomPSP/WADS/PWADS --put the PWADS here

Select with triangle.
Can also view txt-files, scroll with Square button.

-Can now load IWADs that are not named correctly. Just assumes that it's a Doom 2 wad.
This makes for example DUKENUKEM.WAD load and run without having to rename it to DOOM2.WAD

-Compiled against latest PSPSDK

-Changed key usage to cross for selection in wad list and circle to go back.

-Changed exit screen to say "press x to exit" instead of "press y to exit"

-Fixed going back one directory by using circle button.

-Rearranged a bit in the code.

http://thesaint.mine.nu/~stereomike/doompspb6.zip
I would be thankful if someone could mirror the file aswell.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

User avatar
EdwardFMA
Posts: 40
Joined: Wed Jul 06, 2005 11:47 am

Post by EdwardFMA »

Awesome i've been waiting for this ^^ just posted this over at PSPUpdates (ofcource giveing you credit and posted the mirrors) you should get the Front Page for it.

Suggestion: Music is alittle too low LOL I love the Music for doom ^^ also my video is running off the edge by i would say 8 to 16 Pixel and those 8-16 pixels are showing up on the other side ^^ Other than that awesome release keep up the good work! =D
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
Produkt
Posts: 12
Joined: Mon Aug 15, 2005 10:17 pm

Post by Produkt »

Wonderfull work

The only thing I could hope for now is GL rendered Doom :D

But this Is much better, it will save many steps in playing PWADS
Wraggster
Posts: 121
Joined: Fri Aug 26, 2005 7:40 am
Contact:

Post by Wraggster »

Awesome work Stereo Mike, ive posted the news on my site and mirored both files on my comprehensive Doom PSP page --> http://psp-news.dcemu.co.uk/doompsp.shtml

Great work :)
Webmaster of http://www.dcemu.co.uk

DCEMU The Worlds Only Homebrew & Gaming Network of Sites.
StereoMike
Posts: 5
Joined: Sun Dec 11, 2005 11:06 pm

Post by StereoMike »

I'll see what i can do about the volume of the music.

The strange rendering bug is something that seems to occur not all the time and i'm working on finding the problem. EdwardFMA, are you running it on the eboot-loader on fw2.0 or on 1.5? Has anyone tried it on 1.5? Is the problem still there?
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

From people's description, it sounds like a problem I was occasionally seeing with SDL a few months ago right around when all of the hardware accelerated stuff was being put in. I haven't checked it at all recently, and it's probably been fixed by now, but it might be worth looking into.
User avatar
EdwardFMA
Posts: 40
Joined: Wed Jul 06, 2005 11:47 am

Post by EdwardFMA »

I'm running it on 1.5 other than those problems it's great! ^^
EdwardFMA/IchigoKurosaki - PSP Expert
Athlon 64 - Socket 939 - 3000+
1GB 333 DDR-Ram
Geforce 6600 GT PCI-Express

Orbis PSP Development
Open-Source Development
StereoMike
Posts: 5
Joined: Sun Dec 11, 2005 11:06 pm

Post by StereoMike »

I've found the bug with the screen alignment and the music volume so i'm releasing a fixed version.

http://thesaint.mine.nu/~stereomike/doompspb6fix.zip

Changes in Doom-PSP v0.04 S.S b6 fix

-Fixed problem with screen alignment
Was a problem with the memory aligment of the texture.

-Increased the music volume to a normal level
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

StereoMike wrote:Was a problem with the memory aligment of the texture.
I changed newlib's default malloc alignment to 16 to better match the PSP hardware requirements and prevent this kind of problem in the future.

Also, new mirror: http://psp.jim.sh/doom/doompspb6fix.zip
User avatar
sherpya
Posts: 61
Joined: Mon Oct 03, 2005 5:49 pm

Post by sherpya »

I was coding a similar solution for heretic, but I was too lazy to rewrite timidity code to preload instruments, btw I've seen in your port that you are using old style mus2mid conversion over a tmp file,
I've a different code that takes a memory buffer for the mus and builds a timidity midi song without using file i/o

you must use these proto:

Code: Select all

extern MidiSong *Timidity_LoadMus(char *midifile);
extern MidiSong *Timidity_FromMus(unsigned char *data, int len);
LoadMus works like LoadMidi, FromMus picks code from the provided buffer.
tipical usage is:

Code: Select all

int I_RegisterSong(void *data, int len)
{
    MidiSong *song = Timidity_FromMus(data, len);
    return (int) song;
}
and

Code: Select all

music->handle = I_RegisterSong(music->data, W_LumpLength(music->lumpnum));
this file needs the timidity rippout of sdl-mixer but it should work
with some mods on other timidity ports:
http://oss.netfarm.it/psp/heretic/readmus.c
tekno5
Posts: 1
Joined: Thu Jan 05, 2006 1:47 am

Post by tekno5 »

great work thanks for the fix

but in doom2 there is a chainsaw / map problem that has been running for a few versions of the doom port now.

when playing doom2 on level 1
start the game then turn around and walk through the tunnel to find the
chainsaw, when you pick it up the map comes up.

close the map then go through the weapons and when you get to the
chainsaw again the map comes up again.

this problem was not in the first few ports of doom but it has never gone away since the first port that had this problem.

any ideas?

Regards.
nu_world_order
Posts: 2
Joined: Fri Jan 06, 2006 1:52 pm

Post by nu_world_order »

Just a quick follow-up on the music. I have replaced the open source organ.pat with the one from my Gravis Ultrasound - and it sounds AMAZING! I wanted to go through and replace the other patches with my originals, but can't find some of the instruments (for example for the SAX.pat, i have a treblesax, tenorsax etc). If I place ALL my GUS patches in the folder, will it pick them up automatically, or do I have to use the naming system that StereoMike has setup?

I love my Gravis Ultrasound - I was such a Doom freak back in the day I spent around $500 Australian dollars importing one from Canada... haha wasted youth rules.

Thanks StereoMike - Doom is just not the same without the music!
StereoMike
Posts: 5
Joined: Sun Dec 11, 2005 11:06 pm

Post by StereoMike »

sherpya wrote:I was coding a similar solution for heretic, but I was too lazy to rewrite timidity code to preload instruments, btw I've seen in your port that you are using old style mus2mid conversion over a tmp file, I've a different code that takes a memory buffer for the mus and builds a timidity midi song without using file i/o
Yes, it sure felt like a bit of a hack with the tmpfile, but i'll take a look at your code for the next version and see if i can fix it up. Thanks!
tekno5 wrote: this problem was not in the first few ports of doom but it has never gone away since the first port that had this problem.

any ideas?
Well, i see the problem on my side too. I'll see what i can do in the next version. Shouldnt be too hard to fix i think.
nu_world_order wrote:Just a quick follow-up on the music. I have replaced the open source organ.pat with the one from my Gravis Ultrasound - and it sounds AMAZING! I wanted to go through and replace the other patches with my originals, but can't find some of the instruments (for example for the SAX.pat, i have a treblesax, tenorsax etc). If I place ALL my GUS patches in the folder, will it pick them up automatically, or do I have to use the naming system that StereoMike has setup?
Well, you need to edit the timidity.cfg file to point to the correct instruments. Try looking here at a sample config filehttp://timidity.s11.xrea.com/files/cfgs/eawpats.cfg and also the documentation for Timidity might point you in the right direction. The biggest problem with using better a patchset is memory, but feel free to test.
nu_world_order
Posts: 2
Joined: Fri Jan 06, 2006 1:52 pm

Post by nu_world_order »

Thanks for the reply StereoMike! Off to try some repatching :)
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

Hi!
Can you tell me, where I can find the libtimidity for the psptoolchain?
May the force be with us!
psPea
Posts: 60
Joined: Sat Sep 01, 2007 12:51 pm

Post by psPea »

Check the doom source or here
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

Got it! Thanks!
May the force be with us!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I suggest you use the minipats I put together for RotT and Duke3D. You can find them here:
minipats.zip

They're only slightly more than 4MB, but still sound excellent. You won't find a better set of instruments for the size.
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

I was building the psp port of openttd with the incusion of libtimidity.
But if I include it, it builds, but the game does not start. Without
libtimidity it works fine. I have copied the timidity.cfg and inst from
the doom port, but no success.
May the force be with us!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Remember that timidity is gonna allocate a SHITLOAD of memory when it starts... mostly due to the instruments. If you don't have much memory after the game itself is loaded, you may need to do something else for music. At least try it with a set of smaller instruments.
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

How can I watch memory load on PSP with a running application?
May the force be with us!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The same way you debug anything else on the PSP - with psplink/gdb or logging. I'm a traditional programmer, so I go for logging. Do things like print out the results of memory allocations and stuff.
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

I am new to PSP programming.
I have compiled an older version of the game openttd
(0.5.3 from sourceforge). It is compiled with libtimidity,
and midi music works.
You mean, that it is possible, that the PSP runs out of memory,
while loading midi, that the game has grown so much 'til
the last versions? It it is possible, that earlier versions had
no memory problems while loading timidity?
May the force be with us!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I'm saying one of the most obvious differences could be the instruments. Switchings from a set that's (for example) 8 MB to one that's 30 MB clearly has great potential to make the game run out of memory the moment the instruments are loaded. Many libs like timidity simply abort the program when they run out of memory. It's up to you as the programmer to make sure everything fits into the memory available.
mase
Posts: 23
Joined: Fri Aug 21, 2009 3:04 am

Post by mase »

I don't think, it is a memory problem. I had only the piano part in
my timidity.cfg. The game does not start. Maybe the timidity
implementation in openttd is wrong. But I cannot see any mistake.
Maybe someone can compile it and test.
May the force be with us!
Post Reply