GameCube, GP2X and Quake 2

16 02 2008

It’s been a while since I bought a GP2X and I’ve not done much coding for it. Partly this is due to the firmware start-up time — it takes about a minute to get from the Makefile copying the ELF onto my SD card to actually running the build.

I don’t know if this is a Linux problem (not too likely) or a GP2X problem (rather more likely), but a 30 or 40 second start-up delay for a portable game playing device is completely insane. I don’t know how GPH sleep easy at night!

But anyway, for a while I’ve had a GameCube port of Quake 2 in the works. It looks like it’s going to run fast enough but as usual with Quake 2 ports, memory is a problem. I’ve stripped out some memory hogs and tried to shrink down some allocations so while I’m fairly sure Quake 2 for GameCube will happen, I can’t make any promises.

In order to make Quake and Quake 2 development easier, as well as their GameCube versions I maintain a Win32 SDL version of both games. This lets me quickly compile and test platform independent changes without messing around with SD cards or adaptors or waiting for devices to boot.

Given that the GP2X comes with SDL installed I thought I’d quickly adapt my GameCube Makefile for a GP2X version and see how well it ran.

SlowCPU is sloooowwww!

The GP2X has no FPU and Quake 2 does a fair bit of floating point maths, even in the innermost span renderer. The end result is a frame rate just over 5 frames a second (compared to the GameCube’s “easy” 50 FPS).

The Cube is so cute and cuddly, but inside its cheeky purple shell lives a beefy monster!

Anyway, I noticed a few easy performance fixes and by making some changes managed to pretty much halve the time taken to render world spans on the Win32 build. I would imagine the GP2X build won’t see nearly that improvement though as I’ve not yet done any fixed point conversion.

I’ll leave the details of the changes for another time.


Actions

Information

8 responses

17 02 2008
Tom

My gp2x takes 24 seconds to coldboot to the main menu. Which firmware are you running?

Anyway, I wanted to ask why you need to boot each time you recompile? There are various ways to move files onto the device without having to turn it off or remove the SD card; the gp2x can act as a dumb usb storage device, supports (out of the box) telnet access, ftp, samba (‘windows network sharing’) etc.

Sorry if I missed the point :)

17 02 2008
Pete

Unfortunately (as I understand it) GPH changed the USB chip for the F-200, stopping the use of TCP over USB.

I tried using it as a storage device one time, but the SD Card got corrupted. Maybe I should give it another shot.

Thanks!

19 02 2008
Doom5

Quake and Quake 2 are fully playable on the DS. http://quake.drunkencoders.com/

SimonJHall ported both, and dealt with the lack of memory on the DS and lack of a floating point unit very well.

Maybe his source would help you?

20 02 2008
Pete

I’ve talked quite a bit with Simon regarding optimisations for Quake and Quake 2, but we’ve mainly been talking about lowering memory and/or stack usage.

When Q2 DS was released I did a quick “diff” to see the differences between my code and Simon’s, and found that the fixed point optimisations were solely in the DS renderer.

Both the GameCube and GP2X builds currently use a slightly optimised software renderer, based on id Software’s.

I’m not sure which renderer Simon’s is based on, but I should look into it. I would presume it’s based on the OpenGL renderer, but that may not be the case.

And indeed, it may be faster on GP2X to base a software renderer on the OpenGL renderer, just skip all the potentially costly construction of spans and put up with the overdraw.

Thanks for your comment!

20 02 2008
Doom5

I didn’t know you had spoken to him already. I’m pretty sure for both Q1 and Q2 DS he based his renderer off the software renderer in each engine, and used the DS’s 3d hardware to accelerate that.

I don’t own a GP2X, but doesn’t it have a pretty weak graphics processor? The CPU is pretty speedy, but doing all the rendering on the CPU would surely be slow.

20 02 2008
Pete

You’re right about Simon basing the DS renderer off the software one. I had a chat with him this morning and he confirmed it.

3 03 2008
Simon

Hello mate, how’re your ports going? Did you stick with the gp2x one in the end?
Oh and I know what you mean about the GC being “cute and cudly” – I really wish I had something to code for it!

4 03 2008
Pete

I’m concentrating on Quake 1 and SDL for the GameCube at the moment, as it would be nice to call Quake “done” and get a version of SDL into the devkitPro CVS for others to use.

I’ll probably go back to the GP2X port of Quake 2 after that. I’m going to be pretty busy over the next while with assignments and exams, but hopefully I’ll get some homebrew time too.

Cheers!

Leave a comment

You must be logged in to post a comment.