• Steam recently changed the default privacy settings for all users. This may impact tracking. Ensure your profile has the correct settings by following the guide on our forums.

Duke3D For PSP Slim

x3sphere

Administrator
Staff member
Enforcer Team
Game Info Editor
pspslimduke.jpg


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:[blockquote2]* MrPeanut - Gave me a hand while still learning
* HardHat - Always ready to help
* InsertWittyName - For the quick stress free advice[/blockquote2]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
 
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
 
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
 
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. :)
 
<p>the source is avaliable at
www.68kshrine.net/temp/jfbuildandduke.zip</p>
<p>Cheers!</p>
<p>wally</p>
 
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?
 
<p>Heh, i said exactly the same to Mr Peanut.</p>
<p>the correct makefile is located in jfduke3d_psp_mrp_98</p>
<p>All the other folders are just linked somehow (Don't ask)</p>
<p>Wally</p>
 
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:
 
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:

Code:
		/* 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.
 
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
 
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.
 
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
 
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!
 
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.
 
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.

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.
 
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
 
Back
Top