forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to make an ingame screenshot tool ?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
loko



Joined: 23 Jul 2005
Posts: 6

PostPosted: Fri Jul 29, 2005 1:28 am    Post subject: How to make an ingame screenshot tool ? Reply with quote

How to make an ingame screenshot tool ? How method do I need to use, and simply is that just possible ?
Back to top
View user's profile Send private message
Andon



Joined: 10 Jul 2005
Posts: 15
Location: Florida

PostPosted: Fri Jul 29, 2005 1:56 am    Post subject: Reply with quote

You need to know the framebuffer pixel format first of all, either 16 or 32-bit (and the order of the color channels), and then it's pretty easy.

Pseudo Code:
Code:

#include "pspge.h"

char* frame_buf;

...

frame_buf = (char *) sceGeEdramGetAddr ();


Now frame_buf points to the VRAM.

Now, each pixel is either 2 or 4 bytes long, so for a full screenshot (480x272), you'd read (pixel_bytes * 480 * 272) from frame_buf into your own buffer.

You could write this straight to the Memory Stick and use it as is, but normally you'd want to encode it into TGA, PNG, JPG, etc. Depending on your encoder of choice, you may need convert each pixel swapping Blue and Red, range (de)compressing color channels and such before you can even encode it.

Encoding to TGA is fairly trivial and can be done without any library. PNG and JPEG both have PSP ports you can use, look in SVN. I believe there was also a tutorial several months ago on writing to a BMP, search the forum...
Back to top
View user's profile Send private message
Saotome



Joined: 03 Apr 2004
Posts: 182

PostPosted: Fri Jul 29, 2005 4:33 am    Post subject: Reply with quote

There were already threads on this topic providing even complete source code. I bet if you use the search function you'll find at least two threads.
_________________
infj
Back to top
View user's profile Send private message
Agoln



Joined: 08 Jun 2005
Posts: 326
Location: Fort Wayne, IN

PostPosted: Fri Jul 29, 2005 6:44 am    Post subject: Reply with quote

Here: http://forums.ps2dev.org/viewtopic.php?t=2107
_________________
Lego of my Ago!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group