View previous topic :: View next topic |
Author |
Message |
Maximus32
Joined: 27 Aug 2007 Posts: 41
|
Posted: Sun May 17, 2009 4:50 am Post subject: [PS2] Screenshot support for ps2link |
|
|
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 |
|
|
misfire
Joined: 06 Sep 2004 Posts: 120 Location: Germany
|
Posted: Wed May 20, 2009 10:07 pm Post subject: |
|
|
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 |
|
|
Maximus32
Joined: 27 Aug 2007 Posts: 41
|
Posted: Wed May 20, 2009 10:58 pm Post subject: |
|
|
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 |
|
|
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Jun 23, 2009 7:48 am Post subject: |
|
|
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 |
|
|
|