[porting suggestion] Quake 3 for PSP-Slim (with 64Mb RAM)?

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

Moderators: cheriff, TyRaNiD

J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

SamuraiX wrote:Hate to bring up an old topic but it seems Moonlight has incorporated the addition 32 MBytes to Malloc() when using his SDK for M33-3 (Looking at sample memory test).

This is great news, meaning if you include the SDK with your current project you will now have direct malloc access to the additional memory.

I can't wait to incorporate support for additional memory on my project (OpenBOR) now!


Thank You Moonlight!!!
It's a little odd how he adds it.

Code: Select all

/**
 * Sets the partition 2 and 8  memory for next loadexec.
 *
 * @param p2 - The size in MB for the user partition. Must be > 0
 * @param p8 - The size in MB for partition 8. Can be 0.
 *
 * @returns 0 on success, < 0 on error. 
 * This function is only available in the slim. The function will fail
 * if p2+p8 > 52 or p2 == 0
*/
int sctrlHENSetMemory&#40;u32 p2, u32 p8&#41;;
If you look at the sample, it changes the setting, then reloads itself. It looks like your app will have to reload itself to make automatic use of the extra memory. You start off in the normal (24, 28) mode, and you'd have to set it to (52, 0) to get all the extra memory.

EDIT: I just tried (52,0) and it works. After reloading, you have a max free block of 52624kB and a malloc of 51MB succeeds.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

J.F. wrote:
SamuraiX wrote:Hate to bring up an old topic but it seems Moonlight has incorporated the addition 32 MBytes to Malloc() when using his SDK for M33-3 (Looking at sample memory test).

This is great news, meaning if you include the SDK with your current project you will now have direct malloc access to the additional memory.

I can't wait to incorporate support for additional memory on my project (OpenBOR) now!


Thank You Moonlight!!!
It's a little odd how he adds it.

Code: Select all

/**
 * Sets the partition 2 and 8  memory for next loadexec.
 *
 * @param p2 - The size in MB for the user partition. Must be > 0
 * @param p8 - The size in MB for partition 8. Can be 0.
 *
 * @returns 0 on success, < 0 on error. 
 * This function is only available in the slim. The function will fail
 * if p2+p8 > 52 or p2 == 0
*/
int sctrlHENSetMemory&#40;u32 p2, u32 p8&#41;;
If you look at the sample, it changes the setting, then reloads itself. It looks like your app will have to reload itself to make automatic use of the extra memory. You start off in the normal (24, 28) mode, and you'd have to set it to (52, 0) to get all the extra memory.

EDIT: I just tried (52,0) and it works. After reloading, you have a max free block of 52624kB and a malloc of 51MB succeeds.
That is only for custom memory needs. If the memsize=1 sfo flag is set, it will use 52 and 0 by default, unless you use that function for customize your memory needs after a reboot. In that case, the memsize flag will be ignored in next reboot, and the set memory will be used instead.

Summary:
- the memsize flag (PSP_LARGE_MEMORY in the makefile) is 1 or non existant, then normal mode: 24+28

- the flag set to 1: 52+0

- sctrlHENSetMemory+reboot: whatever you choosed.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Ah! I see. Thanks for the clarification. I guess support for the SFO flag will be added to the PSP SDK here soon?
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

J.F. wrote:Ah! I see. Thanks for the clarification. I guess support for the SFO flag will be added to the PSP SDK here soon?
It has already been added. Revision 2333 or greater.
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

Post by SamuraiX »

Now I have a question regarding your sdk. I am looking to use this tonight and if I compile the app with PSP_LARGE_MEMORY=1, will the application still run on a PSP fat? Or should i provide both Slim & Fat Eboots for their respective units with and without the flag?


I can't tell you how much your work means to me! Thank You Moonlight!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

moonlight wrote:
J.F. wrote:Ah! I see. Thanks for the clarification. I guess support for the SFO flag will be added to the PSP SDK here soon?
It has already been added. Revision 2333 or greater.
I tried to update, but there's a problem with the latest newlib that wasn't there a couple weeks ago.
make[1]: Entering directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp'
if test -f gcc/Makefile; then cd gcc && make clean-target-libgcc; else :; fi
make[1]: Leaving directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp'
rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
make[1]: Entering directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp'
Checking multilib configuration for newlib...
mkdir -p -- ./etc
mkdir -p -- psp/newlib
Configuring in ./etc
Configuring in psp/newlib
configure: creating cache ./config.cache
checking for a BSD-compatible install... /usr/bin/install -c
updating cache ./config.cache
configure: creating ./config.status
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... config.status: creating Makefile
make[2]: Entering directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp/etc'
for f in standards.info configure.info; do \
if test -f ../../etc/`echo $f | sed -e 's/.info$/.texi/'`; then \
if make "MAKEINFO=/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/missing makeinfo --split-size=5000000 --split-size=5000000" $f; then \
true; \
else \
exit 1; \
fi; \
fi; \
done
make[3]: Entering directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp/etc'
/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/missing makeinfo --split-size=5000000 --split-size=5000000 --no-split -I../../etc -o standards.info ../../etc/standards.texi
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
make[3]: *** [standards.info] Error 1
make[3]: Leaving directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp/etc'
make[2]: *** [info] Error 1
make[2]: Leaving directory `/home/jlf65/projects/psp/psptoolchain/build/newlib-1.15.0/build-psp/etc'
make[1]: *** [all-etc] Error 2
make[1]: *** Waiting for unfinished jobs....
But makeinfo IS installed and works fine. The dependencies script works fine. I suspect one of the changes made to newlib in the last couple weeks broke this.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

SamuraiX wrote:Now I have a question regarding your sdk. I am looking to use this tonight and if I compile the app with PSP_LARGE_MEMORY=1, will the application still run on a PSP fat? Or should i provide both Slim & Fat Eboots for their respective units with and without the flag?


I can't tell you how much your work means to me! Thank You Moonlight!
It is ignored in the fat.

J.F. today i installed the full toolchain in a laptop, and it worked. Only the 9th script (psplinkusb) failed, but the newlib and the others worked.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

moonlight wrote: J.F. today i installed the full toolchain in a laptop, and it worked. Only the 9th script (psplinkusb) failed, but the newlib and the others worked.
I guess I should have been a bit more specific - it's failing in Fedora. I also recently installed the toolchain successfully - on Xubuntu. There was a similar problem months back the other way around - it worked on Fedora and didn't in Ubuntu. I guess it depends on the distro of the person making the particular update.

EDIT: If you're having trouble connecting to redhat (which prevents you from even starting the newlib step) right now, it's because Fedora 8 just got released. The redhat servers are down from the load. :)

EDIT #2: I installed Ubuntu 7.10 and did a fresh install. It works fine now, the example coming up as (52,0) with the flag set. Kinda odd about Fedora not working though. It was definitely something in the last few weeks that changed as I kept the toolchain, sdk, and libs all up to date.
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

So, did anyone try to compile q3src for pspslim? Any success?
00000110 00000110 00000110
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

I have had a go at trying to port Quake 3 to the slim, which is based on the pspgl one that comes with the pspgl library. It's Makefile and initialization main code out of date, I've updated it so it now compiles with no errors. (Thanks J.F.!)

In psplink, it gets as far as the "finished R_Init" message but then I get an exception error. I get GL errors before I get the exception, but even with commenting out the specific gl lines just to see how far it gets, it stops at the same place.

I've come to the conclusion that this project is way too large for one person to do, so I ask if anyone is interested in trying to accopmlish this task as a team. (I certainly don't think I can do it alone anyways).

I'm not the best programmer, but I'm willing to learn as much as possible to accomplish this goal :)

I have a few questions in mind, namely, does the cgame, game, ui vm's need to be recompiled as prx's ? With it being 'virtual machine' I'd imagine that you wouldn't need to do such a thing. At least its not the same with Quake 1's progs.dat. If we can do vm's on the psp, that would make all the quake 3 mods out there compatible 'out the box' so to say. :)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

If you look at q3ce, they hardcode the vm to interpreted for MIPS based PDAs/Phones as there is no MIPS based vm for q3. I don't know if the test-q3 code you're working on does or not. As I mentioned in a PM, on updated versions of q3 you would either need to convert the shared libs to prxs or convert the new q3 code back to static compiling. Either task would be a chore. The test-q3 code uses the original release code, so it still supports static compiling... which is what you've been doing.

Note that q3ce also uses downsampled textures. The binary includes a script that converts the textures to 64x64 to save ram. q3ce is very hard to find... it took a LOT of work for me to locate good archives of the source and binary. I've put them on mediafire to help others.

q3ce 1.1b src
q3ce 1.1b bin (for PPC)
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

Thanks for that J.F! Will be most helpful :) I managed to find the q3ce project on Google Code by the way :P but having it in arch form is easier for me.

I'm not sure about what you mean about shared libs and static compiling.

As far as I know, the Quake 3 engine dosn't have any external libraries. Would you happen to be talking about punk buster in the latest patches of Quake 3? If so, I don't mind skipping out on that. I just want to get Quake 3 up and running in the fastest/easiest way possible for now :P

If you mean the Quake 3 game code, then ... ahhh ok. I'm not compiling the game code at all at the moment, just relying on the qvm's in my copy of Quake 3.

So I'm guessing the reason I'm getting the crash is because there isn't MIP based vm support in q3 yet.

Alrighty then, I'll see how far I can get before I ask for help again :P
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

MDave wrote:Thanks for that J.F! Will be most helpful :) I managed to find the q3ce project on Google Code by the way :P but having it in arch form is easier for me.

I'm not sure about what you mean about shared libs and static compiling.

As far as I know, the Quake 3 engine dosn't have any external libraries. Would you happen to be talking about punk buster in the latest patches of Quake 3? If so, I don't mind skipping out on that. I just want to get Quake 3 up and running in the fastest/easiest way possible for now :P

If you mean the Quake 3 game code, then ... ahhh ok. I'm not compiling the game code at all at the moment, just relying on the qvm's in my copy of Quake 3.

So I'm guessing the reason I'm getting the crash is because there isn't MIP based vm support in q3 yet.

Alrighty then, I'll see how far I can get before I ask for help again :P
Quake 3 puts much of the code in a number of dlls (windows) or .so shared libs (linux). That's called shared library. Static compiling is when you link a library like libogg.a directly into the executable.

Where's the google code page for q3ce?
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

http://code.google.com/p/q3ce/

After having a look at emvivre's Quake dedicated server port for the psp, I think it would be better to use that as a base because it already has the game code in static and hard linked form :)

Edit: What in tarnations?! People are still making apps in 1.5 kernal mode?! Heavy use of kernel mode calls too. Sigh ... This is going to take me forever :(
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

Extremely promising project MDave! =) Any progress? Are you still working on Kurok?
00000110 00000110 00000110
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

00000110 00000110 00000110
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

If you're going to suggest ioq3, at least put the proper link for the source. :P

Code: Select all

svn co svn&#58;//svn.icculus.org/quake3/trunk ioquake3
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

Be3f wrote:Extremely promising project MDave! =) Any progress? Are you still working on Kurok?
I gave up on it, unfortunately. I came to the conclusion that even if I got it somewhat working, it would never run fast enough to be enjoyable. And only on slim psp's. Just not worth the effort. Not even if you paid me :P

Even Quake 2 is a struggle for the psp.

Quake 1 is much more of a perfect fit for the psp though. And with it being oh so much easier to upgrade the graphics to make it look as technically advanced as its sequels (minus 4!), well, there you have it :) You should see what the Halo: Solitude team is doing with the Quake-Kurok engine.

If you seriously NEED to play the later Quake games in hand held format, then plan on getting a Pandora instead ;) Thats where I'll be developing after I get one, then bye bye psp!
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

Sadly, but i understand.

I hope Zonk will be back with new Q2 release soon as he promiced. Last time in irc he told that he has already implemented color lightmapping and fixed data unloading while changing game level.

Yeah Q1 is almost perfect on PSP and you've done impressive work with it's engine for Kurok. Oh, how about to releasin Kurok's engine for normal Quake game & mods (with PSPQuake1v1.1 preloadin coniguration menu with mods selection heapsize and so on)? I visited Halo: Solitude site - very promising! How do you like this idea: http://forums.ps2dev.org/viewtopic.php?t=11348 ? Maybe it would be easy to implement hl, q2 and q3 map and model formats in Kurok?
I'm planning to make some mods for Kurok in future, if i'll be still interested in it and have enough time - Serions Dungeons 2 and Despair (i wanted to use DE2 engine, but it's still useless for playable games and Kurok's is much more advanced in game logics and some other things)

Oh, i already have Q2 and Q3 in my pocket, see previous page: http://forums.ps2dev.org/viewtopic.php?t=8935 =)
00000110 00000110 00000110
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

If anyone is interested in it, working (i've tested) iPhone/iPod Touch Quake 3 port with src: http://code.google.com/p/quake3-iphone/
00000110 00000110 00000110
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

Be3f wrote:If anyone is interested in it, working (i've tested) iPhone/iPod Touch Quake 3 port with src: http://code.google.com/p/quake3-iphone/
Neat! Is there a way to try that out without access to a mac and the apple iphone sdk, on my iphone? :P He should put it up on Cydia.

The code could be handy, but unfortunately its based on yet another ARM processor, not a MIPS one. This is important for the VM side of things, so you can play pc mods.

I wonder how the RAM was worked around though, since I believe a huge chunk of it is required for the iphone springboard in any app.
Be3f
Posts: 59
Joined: Thu Mar 15, 2007 9:28 pm

Post by Be3f »

MDave, see rep xsellize in Cydia

Or here you are app (with Q3 demo paks): http://rapidshare.com/files/172662783/Q ... _.rar.html

And this is autoexec.cfg, optimized for iPhone/iPod Touch:

Code: Select all

//AUTOEXEC.CFG 11/30/2008
//RC3
//QUAKE3 for iPhone
//IPHONE AUTOEXEC
//By Scramble
//[email protected]

//FPS ADJUSTER
// Set here the maximum FPS you want to play QuakeIII
// at. Remember the larger the limit, the more CPU
set com_maxfps 40

// Player Name
name iPhone

// Player Model // Edit away!
set model "slash/grrl"
set headmodel "slash/grrl"
set team_headmodel "slash/grrl"
set sex "female"

// Appended Logging System
set logfile "3"

// Remote Console Control ;-&#41;
set rconPassword "alpine" // love that password.

// Draws FPS for iPhone
set cg_drawFPS 1

// Mouse Freelook
set cl_freelook "1"

// Mouse Button Binding
bind MOUSE1 "-zoom" //This is broken just set as a retaining value.
bind MOUSE2 "+attack" //Fire with two fingers
bind MOUSE3 "+moveup" //Jumping with three fingers



// Mouse Sensitivity
set sensitivity "11"

// Mouse Acceleration
set cl_mouseAccel "1.2"
// Mouse Smoothing
set m_filter "0"

// No Inverted Mouse
set m_pitch "-0.0220"
set m_yaw "-0.022"
set m_forward "0.25"
set m_side "0.25"

// New testing...
set cl_yawspeed "175"
set cl_pitchspeed "175"

//System Adjustments
set com_hunkmegs "64" //Half of the iPhones system memory.
set com_zonemegs "24"

// Graphic Optimizations // Volume NO-SOUND
set cg_oldRail "1"
set cg_oldRocket "1"
set cg_oldPlasma "1"
set cg_noProjectileTrail "1"
set cg_hudFiles "ui/hud2.txt"
set r_inGameVideo "0"
set s_doppler "0"
set cg_scorePlums "0"
set r_ext_compressed_textures "1"
set r_ext_compress_textures "1"
set com_blood "0"
set cg_draw3dIcons "0"
set cg_simpleItems "1"
set cg_gibs "0"
set cg_marks "0"
set cg_brassTime "0"
set cg_shadows "0"
set r_picmip "2"
set r_finish "0"
set r_roundImagesDown "2"
set r_lodBias "2"
set r_swapInterval "0"
set r_subdivisions "90"
set r_lodCurveError "125"
set r_colorbits "16"
set r_texturebits "16"
set r_stencilbits "0"
set r_depthbits "16"
set r_dynamiclight "0"
set r_drawSun "0"
set r_fastsky "0" //disable with 1 to gain a few fps - wont be able to see through portals.
set r_flares "0"
set r_textureMode "GL_LINEAR_MIPMAP_NEAREST"
set r_vertexLight "1"
set s_loadas8bit "1"
set s_compression "1"
set s_khz "11"
set s_musicvolume "0"
set s_mixahead "0.14"

// Advanced OpenGL Settings. - Slow Down maybe.
set r_allowExtensions "1" // Force all of the iPhones GL extensions. 
set r_ignoreGLErrors "1" // Ignores all openGL errors.
set r_offsetfactor "-1" // Shouuld fix some flickering problems - OpenGL Polygon Offset.
set r_portalOnly "1" // Another Portal Fix.

// Hardware Frame-Skipping Support
set r_ext_swapinterval "1"

//Headbob settings
set cg_bobpitch "0"
set cg_bobroll "0"
set cg_bobup "0"

//Punk Buster
set sv_punkbuster "0" //Disable that. I dont see anyone porting that.

//Default Multiplayer Menu Options For Faster Server Refresh
set sv_hostname "iPhone/iTouch Quake3 Server"
set sv_maxclients "8"
set g_motd "iPhone/iTouch only!"
set ui_cdkeychecked "1"
set ui_browserSortKey "2"
set ui_browserShowFull "0"
set ui_browserShowEmpty "0"
set ui_browserMaster "2"

//Add a server to your favorites to save from long server refreshs
//set server1 "put favorite game server here xxx.xxx.xxx.xxx be sure to remove rem-out"
00000110 00000110 00000110
MDave
Posts: 82
Joined: Mon May 09, 2005 10:43 pm

Post by MDave »

So ... I hear Quake 3 has been ported to the PSP recently ...

You've been quiet about this Be3f :P thought you would of brought the topic back as soon as it was ported.

Works rather well! Better then I expected actually. Even runs mods, which makes me assume it has a native MIPS compiler for the quake virtual machine? Awesome stuff. Just need the code so we can all help contribute making it faster, better and even more optimised :P

It's available through a psp russian site, but unfortunately I can't link to it because the release includes the whole quake 3 game as well.

Here is a video (not by me) to show case it anyway:

http://www.youtube.com/watch?v=ru3jiaBbHjc

And if you do manage to get hold of it, I recommend adjusting the Q3CONFIG.CFG file because the mip mapping settings are a bit extreme.

Code: Select all

seta r_picmip "1"
seta r_mipmaps "2"
seta r_mipmaps_func "2"
seta r_mipmaps_bias "-6"
EDIT: Scratch that, it's using the interpreter for the VM bytecode. Still works ok! Imagine the speed that could be gained though.
Post Reply