How do games draw 3D data to screen?

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
Coldbird
Posts: 97
Joined: Thu Feb 08, 2007 7:22 am

How do games draw 3D data to screen?

Post by Coldbird »

Again it's me with another PRX linked question.

I do know that the Gu functions the PSPSDK provides are a bunch of asm functions that make stuff more readable...

(So you can pass vertices, etc.)

This are lateron converted to Ge commands... from what I can tell...

But is there a bit more documentation on it?

I intend to hook somewhere into that process of drawing vertices to get my own verticestream into it before rendering to screen...

I thought of doing a little asm function to achieve that... that's not the problem, but I seriously got no idea where to forward into that ASM function to add my own.
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Download pspsdk sources: there are no better documentation. In that package you should even find a txt file with the command codes GU uses to communicate with GE chip.
User avatar
Coldbird
Posts: 97
Joined: Thu Feb 08, 2007 7:22 am

Post by Coldbird »

I figured as much, but I was hoping that someone had previous experiences with the matter.

Thanks anyway jean.
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

If you really want to inject GE commands I would try hooking sceGeListUpdateStallAddr. You would need to do some basic processing of the command list to handle the jump/call/ret commands, keep "dry executing" it until you find the "finish" instruction. Here you can start inserting your own instructions. Then append what was on the end of the original list, I think it's usually a "finish" followed by an "end". You would have to be careful not to overflow the size of the display list.

An easier way would be to just hook sceGeListSync/sceGeDrawSync, then insert a new list before calling the original functions. For sceGeListSync you'd need to call that a second time with your list's ID. You can also manage the list memory yourself with this method.

It's possible a game will sync multiple times per frame (for special effects), so you may not want to inject every single time.
(+[__]%)
User avatar
Coldbird
Posts: 97
Joined: Thu Feb 08, 2007 7:22 am

Post by Coldbird »

Now that's some info I can work with, thanks Smong.
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Post Reply