Quake porting issues

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

Moderators: cheriff, TyRaNiD

PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Quake porting issues

Post by PacManFan »

Howdy everyone.

I'm porting PocketQuake for the psp, and I'm running into some issues. I'm using the latest version of oopo's psp tool chain build script, and I can't seem to get a lot of math functions to link correctly. Everything compiles fine, but the psp-ld linker complains about not finding a lot of __dfs symbols. I did a search in the libraries, and it looks like what I need is in libiberty.a, I've included it, but everythting is still blowing up.

Basically, it seems I can't use floating point math functions, or anything that does a floating point conversion, Integer math seems to work fine.
Is there a library I'm missing somehow? Or a compiler flag to enable floating point math?
any help would be appreciated.

-PMF
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

#1 reason is you're using psp-ld to link your executable. Use psp-gcc instead. psp-gcc will automatically include libgcc.a which has the floating point library glue that psp-ld is complaining about.
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Thanks

Post by PacManFan »

I just figured that out by manually including libgcc.a, it works now. Now I just have to do some major debugging....

-l8r
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Another quake porting question

Post by PacManFan »

OK, I've made some progress, Everything colpiles and links fine, now I'm trying to debug this thing to get it to work properly.
Does anyone have any hints / tips for debugging? Currently, I'm commenting things out and putting in return statements to change/compile/ and run the EBOOT under the PSE emulator. Is there a way to run a debugger on the EBOOT file?

Or can someone tell me if the psp file functions work under the emualtor? I've been having trouble getting the Quake prog. to log debug info to a file. Every time I try to open /write to a file, it crashes the emulator. I haven't tried it yet on the PSP.

Thanks in advance.

-PacManFan
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

PSPQuake status update(if anyone is interested)

Post by PacManFan »

I've got Quake compiling, and linking for the PSP. I've gone as far as I can go with the PSP emualtor, because it doesn't seem to support va args, or seem to support any File I/O functions. I'm running my Quake test application on my PSP now, and I've successfully got it loading up a .pak file. My next step is to implement the video functions, input, and sound. Network support is on hold right now until someone figures out the PSP net function (maybe it'll be me?!?)

My question is: Does anyone know a good way to quickly go through the change/compile/upload/test cycle on the PSP? It still takes me about 1-2 minutes to make a change, and then get it on the PSP to test. At least now I've got a debug log and I'm not going blind.

-PMF
Hippo
Posts: 19
Joined: Sat Jun 25, 2005 10:51 am

Post by Hippo »

You could try using PSPE, although it's certainly debatable how well it functions...
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

This is how I do it:
Keep the KXploit app in the background so it remembers the path. Keep the PSP connected.

After a test run, arrow over to USB mode. Then start coding. When done type make, press Generate files in kxploit (will automatically copy to psp), press circle and arrow over to Game/Memstick/yourtestapp on the PSP and press X. I suppose the kxploit step could be automated better by adding a step to the makefile, that's next on my TODO.
Hippo
Posts: 19
Joined: Sat Jun 25, 2005 10:51 am

Post by Hippo »

After playing around with KXploit.exe, which's found in the folder you installed KXploit Tool in, I've magically discovered that the argument list is as follows: kxploit.exe <PBP to patch> <folder to create on PSP> <output location> <output log> <path to look for arial.ttf?>

For example: kxploit.exe C:\hellopsp\EBOOT.PBP HELLOPSP F:\PSP\GAME

(AFAIK, output log and font path aren't required.)

EDIT: Made a slight mistake...
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Debugging Quake

Post by PacManFan »

Hippo, ector,

Thanks for the tips,
I really wish that PSPE would work. Every time it tries to execute teh code compiled for a va_args (va_start - va_end) function, it crashes. That means it crashes on printf, sprintf, Log(), etc... just about everywhere. The code works on the PSP, I guess the compiler is generating an instruction that the PSPE can't interpret.

Quake is coming along nice. Last night, I got more garbage on the screen. Now I need to keep working out the color map and some of the blitting routines.

-PMF
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

good luck - can't wait to see the fruits of your labour! :D
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Not long now.

Post by PacManFan »

Alright!
I just played my first very crippled game of PSPQuake last night!

Current status:

Controls:
Controls are mapped to the buttons, I may change things around to improve playability.

Video:
The palette needs to be mapped to the correct colors and converted to 16bpp

Audio:
Not implemented.

Network/ Multiplayer:
Not until we can figure out the Network libraries

Today, I'm going to add the audio, work on input mapping, and palette. I also need to go back and look at some video routines I commented out because there were causing crashes.

It's not going to be long now.
I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.

-PMF out.
User avatar
sq377
Posts: 87
Joined: Mon Apr 11, 2005 3:30 am

Post by sq377 »

heh, networking is almost figured out, can't wait to see this. Whats your crippled version of quake playing at, how close to full speed?
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Re: Not long now.

Post by mrbrown »

PacManFan wrote:I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.
As I indicated yesterday, a simple -march=6000 on the GCC command line would've removed the Allegrex-specific instructions.
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Re: Not long now.

Post by subbie »

PacManFan wrote:Alright!
I just played my first very crippled game of PSPQuake last night!

Current status:

Controls:
Controls are mapped to the buttons, I may change things around to improve playability.

Video:
The palette needs to be mapped to the correct colors and converted to 16bpp

Audio:
Not implemented.

Network/ Multiplayer:
Not until we can figure out the Network libraries

Today, I'm going to add the audio, work on input mapping, and palette. I also need to go back and look at some video routines I commented out because there were causing crashes.

It's not going to be long now.
I'd just like to say that the only way that this was possible is because I hacked the gcc 4.0.0 toolchain script to remove the SEB/SEH instructions so I could get this running in the PSPE emulator.

-PMF out.
Any chance you have tried out on a real psp? Have to be careful with what PSPE allows vs the real thing.
zigzag
Posts: 129
Joined: Wed Jan 26, 2005 2:11 pm

Post by zigzag »

Can't wait! What fps are you getting? I guess it should be possible to get full fps?

Is it possible to use the PSP's 3D hardware for it somehow in the future?
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Moving closer

Post by PacManFan »

I've got PSPQuake running at about 8-9 FPS under the PSPE, I'm at work right now ;) , so I don't have my PSP with me. I briefly ran it last night, but it crashes after about 8 seconds on the loading screen. I've got to debug that when I get home.

Status:

Video:
Colors are all correct now, 8-9 FPS in PSPE emulator, not sure what this translates to on a real PSP. I'm going to put in an option to bump up the processor speed to 333 just in case. I rewrote some of the blit routines to copy from the quake frame buffer to the PSP screen with 8->16bpp color mapping, this could still be tweaked / rewritten in assembler.

Controls:
Still tweaking for playablilty.

Audio:
I put in the low level stuff just a little while ago, no longer crashes, still no sound, maybe later tonight or tommorrow.

Network:
Monitoring the Network "Some sceNet / sceHttpInit usage questions" thread intently.


I'll try to post a screenshot soon.
-PMF
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

A screen shot

Post by PacManFan »

Here's a screen capture from the PSPE running PSPQuake.

Image


I'm still working on figuring out why some the text isn't drawing correctly, and why the console background image causes it to crash.

-PMF
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

nice, I hope it works on real hardware.

You deal with missallignment already? (something that original code has a serious issue with).

Also look into maybe having it directly render to the psp framebufffer in 16bit insted of redering to another buffer and having to translate it.
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Beta test version ready

Post by PacManFan »

OK, Here's the deal,

I want to get this release ready ASAP for everyone. The first couple of people to email me get a BETA EBOOT.PBP and the pak file.

A couple of restrictions though:

1)Don't distribute it to everyone else quite yet, I don't want to get slashdotted when this thing is half working.

2) I need feedback for playability / buttons mappings, make some suggestions as to the layout and function.

3) Play test, this is the fun part. report back any crashes /glitches/ graphical errors, etc...


Here's the current status:

Video:
Looks good, runs at about 20 fps (estimate)

Audio:
I'm working on it tonight, hopefully I'll have it by tomorrow.

Controls:
I need some good suggestions as to what to map where.

Networking:
As soon as someone has a Berkley compatible socket API.


Thanks for the help everyone.


-PMF out...
"I'm a little source code, short and stout
Here is my input, here is my out."

Author of PSPQuake and PSPSOne.
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

With some luck you may be able to use hardware in the near future to upconvert from 8-bit to 16/32-bit color ;)
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

email sent. :D
F9zDark
Posts: 127
Joined: Sat Apr 02, 2005 11:34 am

Post by F9zDark »

Email sent. Hope to hear from you. :)
Cogboy
Posts: 45
Joined: Wed Jan 19, 2005 3:45 pm

Post by Cogboy »

mail sent. :)
"the sony PSP was built by god, to determine who on earth had the best skills to defeat the armies of satan" - Saint Peter.
cyberheater
Posts: 4
Joined: Sun Jun 26, 2005 4:36 am

Post by cyberheater »

email sent :)
Hippo
Posts: 19
Joined: Sat Jun 25, 2005 10:51 am

Post by Hippo »

Sent!
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

sent... (aswell)
inomine
Posts: 53
Joined: Thu May 05, 2005 7:26 pm

Post by inomine »

Sent this morning. ;)

I guess a lot of people are going to be interested, it might be easier to just go ahead and post it, statiting that it cannot be redistributed or advertised, that would stop the lot of PSP Hacker getting at it for a while.
goblindojo
Posts: 6
Joined: Wed Jun 22, 2005 7:51 am

Post by goblindojo »

You can send it to a small amount of testers and ask them nicely not to redistribute it, but you can't prevent them since Quake is licensed under the GPL. So PSP-hacker et al could distribute it to all and sundry once they get ahold of a copy.

So PacManFan's original plan is probably best suited for his purpose of having a few people beta test it.
zith
Posts: 4
Joined: Thu Apr 21, 2005 2:47 am

Post by zith »

Maybe this keymapping would work for a game like quake:

Control view with analog "stick".
Walk forward, backwards and strafe with the buttons on the right (x,o etc).
Select weapon and such with the cross.
Shoot with R and jump with L or vice versa.

This could take a while getting used to, but one would want to be able to look in any direction and strafe etc when playing quake =)
PacManFan
Posts: 66
Joined: Sat Jun 25, 2005 6:01 am

Thanks

Post by PacManFan »

Thanks to everyone who responded,

I sent out a beta to the first five who emailed me, and I've already gotten back quite a few usefull comments.

1) The game crashes randomly (I know why now, it's a floating point rounding problem)

2) Controls aren't really mapped to any good inputs (I' m still working on this, I've got a fairly playable setup right now)

3) Framerate could still be tweaked a little.

4) Audio isn't implemented

5) Save and Load don't work.

Most of these things I can fix today.

BTW, I spoke with Malum, the Forum Admin over at PSPHacker.com, and I gave him a copy to preview. He's prepping a news story now, and promised not to distribute anything till I give the go-ahead.

I've got a busy day today fixing bugs
I'll post an update l8r

-PMF out
"I'm a little source code, short and stout
Here is my input, here is my out."

Author of PSPQuake and PSPSOne.
Post Reply