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 

[PS2] Screenshot support for ps2link

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions
View previous topic :: View next topic  
Author Message
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Sun May 17, 2009 4:50 am    Post subject: [PS2] Screenshot support for ps2link Reply with quote

This patch adds screenshot support to ps2link:

- screenshot is written to file host:screenshot.ps2 after screenshot command.
- screenshot command needs width, height, psm, and base-address parameters.
- screenshot.ps2 file uses a custom file format (so ps2 does not need to convert the pixel format).
- a dependency to libdma and libpacket is needed.

Please review the code, and feel free to comment.

[download patch]
[download sample application for windows] - fixed
[see forum topic]
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
misfire



Joined: 06 Sep 2004
Posts: 120
Location: Germany

PostPosted: Wed May 20, 2009 10:07 pm    Post subject: Reply with quote

I think it would be better if you could specify the name of the screenshot file and not use host:screenshot.ps2 as a static target.

Also, we should add screenshot support to ps2client -- the standard client application for ps2link. In my option it's annoying to have an extra (Windows) program for a single ps2link command. I can help you with the integration, but I may need your help when it comes to converting the .ps2 format to .png or whatever.

Anyway, good job so far.
Back to top
View user's profile Send private message
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Wed May 20, 2009 10:58 pm    Post subject: Reply with quote

Thank you for your reply.

The command request currently looks like this:
Code:
typedef struct {
   unsigned int cmd;
   unsigned short len;
   unsigned int base;
   unsigned int width;
   unsigned int height;
   unsigned short psm;
} __attribute__((packed)) pko_pkt_screenshot;


Adding a filename is a good idea:
Code:
typedef struct {
   unsigned int cmd;
   unsigned short len;
   unsigned int base;
   unsigned int width;
   unsigned int height;
   unsigned short psm;
   char file[PKO_MAX_PATH];
} __attribute__((packed)) pko_pkt_screenshot;


Another thing that could be added to this structure is the selection of a sub-area. This could speeds up the transfer when not the entire screen is needed.

Code:
typedef struct {
   unsigned int cmd;
   unsigned short len;
   unsigned int base;
   unsigned int fb_width; // width of the framebuffer
   unsigned short psm;
   unsigned int x; // x starting position of screenshot
   unsigned int y; // y starting position of screenshot
   unsigned int width; // width of screenshot
   unsigned int height; // height of screenshot
} __attribute__((packed)) pko_pkt_screenshot;

Any ideas what's best?

We should add screenshot support to ps2client, I agree. It would be nice if you could help out, but first we need the command request structure to be good. Becouse after it is committed it can't be changed.

I was also hoping someone would comment on the function "graph_vram_read_xy", as it's a modified version of "graph_vram_read", and probably should end up in libgraph. However, this does add another dependency to libgraph.

Converting from the .ps2 format needs to be done by a separate tool since the ps2 writes the file directly to your pc. I hate using a separate tool though, but I could make one if needed. I would prefer the ps2 to store the file in a more standard format, like bmp or tga? Do they support the ps2's 16/24/32bit format?
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Jun 23, 2009 7:48 am    Post subject: Reply with quote

Code:
Sending        ps2link/Makefile
Sending        ps2link/ee/Makefile
Sending        ps2link/ee/cmdHandler.c
Sending        ps2link/ee/ps2link.c
Sending        ps2link/include/hostlink.h
Sending        ps2link/iop/Makefile
Sending        ps2link/iop/cmdHandler.c
Transmitting file data .......
Committed revision 1594.
thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions 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