Duke3D For PSP Slim

Posted by x3sphere at May 23, 2008, 6:46 pm


Homebrew developer Wally today sent over an updated build of the Duke Nukem 3D PSP port originally written by MrPeanut, complete with support for Slim units. Since various individuals assisted him in the creation of the release, the author would like to send thanks to the following developers:

* MrPeanut – Gave me a hand while still learning
* HardHat – Always ready to help
* InsertWittyName – For the quick stress free advice

As with previous builds, a shareware or retail version of the DUKE3D.GRP data file is required to play. The file itself should be placed inside of the Duke3D folder contained in the archive below.

Download Duke3D For PSP Slim

Read moreDuke Nukem 3D PSP Build 97, Duke3D PSP Build 98, Uberjack’s Emulator Suite Now PSP Slim Compatible, Update: Chilly Willy’s Duke Nukem 3D Port, Wolfenstein 3D PSP v4.8: VSync Support, Audio Enhancements

Comments

Chilly Willy says:

Hmm... not bad, but it still has the audio sample rate bug, and crashes when you try to exit.

Wally1 says:

Yeah, i'm still yet to learn how to do that yet Chilly Willy :P

Noob I am yes!

People should expect some more releases here in the future!

Wally

Wally1 says:

I'd like to acknowledge the following:

stereomike made the original PSP port, MrPeanut followed it up. My bad.

Also Chilly Willy, MrPeanut said that there is an app which he has made that fixes the audio sample bug. Its avaliable here
[rapidshare.com]


Wally

Chilly Willy says:

Hey Wally! Good to see you here. If you post the source, maybe I can help with the audio bug. I don't see why you should have to use a Windows app to resample the sound. There are ways to change the PSP's sample rate. You could also resample the audio on the fly if needed. :)

wally says:

the source is avaliable at
www.68kshrine.net/temp/jfbuildandduke.zip


Cheers!


wally

Chilly Willy says:

Cool. I'll start looking into the sound.

EDIT: Just to be certain - there's three source folders in the arc... which one are you building from?

wally says:

Heh, i said exactly the same to Mr Peanut.


the correct makefile is located in jfduke3d_psp_mrp_98


All the other folders are just linked somehow (Don't ask)


Wally

wally says:

OH and don't forget about Basilisk 2 xD

fungusinmymilk says:

Duke Nukem 3d is one of my most favourite games.

very much looking forward to a stable port on the psp!

thanks for picking up the project guys :smile:

Chilly Willy says:

Okay folks, try this out... just drop it in place of the EBOOT.PBP you already use.

http://www.mediafire.com/download.php?x3l2vivjnjy

It fixes the audio pitch problem for me. The source of the trouble is actually SDL - SDL has the ability to convert samples from one format and rate into another, and Duke3D uses that. The problem is in SDL_audiocvt.c:

/* We may need a slow conversion here to finish up */
if ( (lo_rate/100) != (hi_rate/100) ) {
#if 1
/* The problem with this is that if the input buffer is
say 1K, and the conversion rate is say 1.1, then the
output buffer is 1.1K, which may not be an acceptable
buffer size for the audio driver (not a power of 2)
*/
/* For now, punt and hope the rate distortion isn't great.
*/
#else
if ( src_rate < dst_rate ) {
cvt->rate_incr = (double)lo_rate/hi_rate;
cvt->len_mult *= 2;
cvt->len_ratio /= cvt->rate_incr;
} else {
cvt->rate_incr = (double)hi_rate/lo_rate;
cvt->len_ratio *= cvt->rate_incr;
}
cvt->filters[cvt->filter_index++] = SDL_RateSLOW;
#endif
}


Notice that the "slow" conversion isn't enabled. SDL by default only does conversions by powers of two. If the difference in the sample rate of the sample and the audio playback rate isn't a power of two, SDL only scales is to the closest power of two. That's why the Duke3D sounds are all off. If you change that "#if 1" to "#if 0", the sounds will be fine. My executable is compiled with the SDL compiled that way.

One point: this isn't a fast conversion. Duke3D waits until a sound needs to be played the first time before doing the conversion. This means there's a brief pause right as the sound effect is used (or not so brief for some of Duke's one-liners). I'll probably try adding code to force all the sound effects to be converted right at the start of the level or something.

Note that this version also exits to the XMB, and allows you to exit via the Home button as well.

Chilly Willy says:

Okay, here's test 2.

http://www.mediafire.com/download.php?ep1ghmtd1zg

I expanded the heap to 16 MB. The earlier value (10 MB) caused sounds to not be played, especially when the music was playing. I suppose it ran out of heap space for the sounds.

I also set the optimization level to 1. The code base for this is pretty lousy - if you set the optimization level higher than 1, it crashes. Even at O0, it still had a tendency to crash after using the menu, or restarting a level. I suppose someone needs to make a conversion of EDuke32 instead of old JFDuke code. Oh well.

EDIT: Here's the source for test 2.
http://www.mediafire.com/download.php?0p2xd1gmk2e

wally says:

Sweet!


Good on ya chilly willy :)


I'll test when i get home.


Wally

Chilly Willy says:

The only files that were changed were:
sdlayer.c - altered heap size, fixed callbacks, and added callback setup to main
game.c - added sceKernelExitGame() right before ShutDown()
Makefile - some changes to get it to compile with the latest toolchain/sdk in linux

And of course, I changed SDL_audiocvt.c as mentioned previously.

midnitdragoon says:

i registered just so i can post on this topic. I love Duke Nukem 3D and i love you for undertaking this project so well!!!! Thank you! Quick question how do i enable music? trying to get it to work but dunno where to start arrrgh

midnitdragoon says:

ok i tried this new version and its a little skippy dunno why. other than that no crash when trying to exit =D. anyone know how to add music?

ok i read above and realize why it skips hehe!

Chilly Willy says:

Download the timidity instruments from here (Warning! 14MB file):
http://www.libsdl.org/projects/SDL_mixer/timidity/timidity.tar.gz

Put the timidity directory that is inside that arc into the Duke3D directory on your PSP. Then put this file (inside the attached zip) in the Duke3D directory as well.

Haven't had the chance to look into preloading the sounds yet. Maybe this weekend.

midnitdragoon says:

oooo ok very i got that to work thanks Willy!! Well i played through the first level fust fine. Now when getting to second level loading it went to "Generating Music Data... Wait, Please." and just frose there. Dont know what thats about hehe. Well anyways gonna keep trying other duke levels and let you know whats up =D

Edit- Ok i tried episode 2 and got passed the first level. When it got to the loading screen for the second level it froze and shut of my psp at the "Generating music data..." screen.

Chilly Willy says:

Thanks for the report... I'll look into that. Might be an issue with how the current code releases the memory for the old score, or how it deals with the temporary file generated.

Chilly Willy says:

Okay, as far as I can tell, the problem with the music going from level 1 to level 2 is the fault of timidity. Timidity is used by SDL_mixer to play the MIDI scores, but when timidity is converting the score, if it runs out of memory, it tries to exit the program instead of simply not playing the music. Go fig. Anywho, trying to exit on Duke3D blows up, which is why it hangs when it tries to convert the score for level 2. I haven't figured out a way to limit the memory or flush the memory in use (sound effects). So music is a no-go at the moment. :(

On the plus side, this test version has the speed bumped to 333MHz, which makes the sound effects conversion less noticeable, and the game a bit smoother. I also added TV support to SDL, so now you can play Duke3D on the TV on the Slim. When you start the app, hold down the TRIANGLE button. You'll get a set of message dialogs asking about what video settings you want SDL to use. If you don't have a Slim, don't have the dvemgr.prx, or don't have a cable, it only asks if you wish to make the display wide screen (480x272) or not (364x272) on the LCD. That's good if you want to play Duke3D in the original aspect ratio.

If you have a Slim, the dvemgr.prx, and a cable, then you get asked if you wish to use the TV output, if you wish to do interlaced output (if you have the component cable - composite is ALWAYS interlaced), if your TV is 16 : 9 (HDTV), and if you wish to make the display widescreen. Just try a few different settings to see how it works. It writes this data to a prefs file so that the next time you run the app, it'll use those same settings (unless you hold TRI again).

So here's test 4: http://www.mediafire.com/download.php?mvzzye0amqi

B2K24 says:

Sorry if this sounds very stupid but is this the same game as the DOOM you ported?
I ask this because certain games I don't know that well.
If it's a different could you point me to where I can get the whole archive?
then I will grab the updated eboot from this thread.

Anything your working on I will happily download and give it a run as im a big fan of your work weather I am familiar with the game or not as im a big fan of your work and projects :)

midnitdragoon says:

thanks for the update!! im going to test this baby out!! =D

midnitdragoon says:

Okay so i went through the first level in hollywood holocaust. I must say this version is running very very smooth even with the duke voice fix! Theres only small instances( not very common at all) where i guess the level is loading somehting and it skips for a millisecond. Almost unoticible!( but i notice =P. So i run through the first level and hae a question. What happend to the pig cops voice? other than that this release is very very stable folks. just a few more tweaks and we have a perfect port! if the music wasnt a issue it woulda been perfect =D! But anyways im going to play through some more and see how it goes.

midnitdragoon says:

Oh im also haveing a rough time figuring out a control scheme. Is there a sheet with what the basic buttons are called?

Chilly Willy says:

This is an update to the Duke3D arc at the start of the thread. I only included the eboot and the DVE manager prx as it's a test. Get the full arc and then replace the eboot and add the prx.

If you don't know the difference between Doom and Duke Nukem 3D, I suggest looking them up on wikipedia. You'll find a nice explanation and background info on both. :wink:

@midnitdragoon - Because of the way this particular code base handles sound effects, it floods memory and still drops sounds every now and then (and leads to the issue with the music). This old version of jfbuild is rather a mess. Things won't get any better unless a move is made to some newer code, like eduke32.

If you use the config file from the arc at the start of the thread, you'll get the controls seen here: http://www.dcemu.co.uk/vbulletin/showpost.php?p=553865&postcount=36

midnitdragoon says:

awesomeness im going to use this right now!!!

ireally qwish i knew how to code so i can help u guys!!!

B2K24 says:

OK LOL thanks. I overlooked the fact that this thread was 3 pages.
Thanks, look foward to trying this out :)

Chilly Willy says:

Everyone starts somewhere. I don't suggest you start on a game console, though. They usually have special requirements and tools above the normal programming. Start on simple programs on a PC. On linux, the normal gcc toolchain and an IDE like Code::Blocks or Geany is the place to start. On Windows, most people use VisualToilet, but you could also go with gcc as well (CygWin or MINGW gives you gcc/posix on Windows) and use the Bloodshed IDE with it. Pick up a copy of C for Dummies and work on simple stuff to begin with - simple text games like mastermind are good beginner lessons. Once you have an idea of how c works, start looking at the source for existing programs. Nothing teaches you how to do practical things like file requesters and such like looking at how other apps do it. Why, just yesterday, some idiot was over at ps2dev asking how to recursively delete a directory!! You can find that already done in many places on the net. If you ask questions like that, the best you can hope is a polite ref to google. :biggrin:

@B2K24 - No prob. Once I get enough improvements, I should put together a full arc for folks.

buckrogers says:

I was looing for Duke 3D for my PSP as I already had an original dos copy,from when it first came out.( I'm old ya see ). Followed your advise and now have D3 on my PSP PHAT 4.01 M33-2. Works a treat. Thanks

midnitdragoon says:

sorry to bump such a old thread, but im wondering how can i increase duke nukems run speed. i know that if i press start using the download config files it allows me to run, but its still much too slow. Any way to change that so he runs much faster than that??

midnitdragoon says:

just some feed back on the game so fr. I re configured the controls here it is. I think its a better more confortable control scheme for people here. Only problem is i have to change the scale sensitivity up high for moving to be fast. I wish i can just switch dpad commands with the analog. Id much rather move with dpad.

Anyways i found a new bug in the game. While making my run through Duke 3d episode 1 lvl 2, i entered the secret passage in the begginging where you get into a sewer and fight your first octa-brain. After it died my psp froze. Pretty weird.

Anyways hope some one is still working on this gem =D

midnitdragoon says:

the bug i was talking about earlier is non sense, im now playing the game flawlessly, few slowups here and there but over all very fast. Some things that need to be fixed are

1) Darkness in dark areas. I cant seem to tweak the brightness settings in game for these areas to be navigationable.
2)Save is kinda bugged.

Over all its a great port, but i think the controls need re modifying.

you say:

Login with your username and password below. New User?





ss_blog_claim=bf55edcce6ff2f078693a24c8876e229