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]
[PS2] Screenshot support for ps2link
[PS2] Screenshot support for ps2link
Bricks-OS, Operating System for Game Consoles
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.
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.
Thank you for your reply.
The command request currently looks like this:
Adding a filename is a good idea:
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.
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?
The command request currently looks like this:
Code: Select all
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;
Code: Select all
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;
Code: Select all
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;
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
Code: Select all
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.