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 

Taking screenshots with ps2link

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



Joined: 27 Aug 2007
Posts: 41

PostPosted: Mon May 04, 2009 8:27 am    Post subject: Taking screenshots with ps2link Reply with quote

I'm currently working on an application much like InLink. Becouse it's built using Qt it should run on Windows, Linux, Mac and more. One feature I really missed in InLink was the ability to make screenshots, so I modified ps2link to be able to save a screenshot (using the ps2sdk function ps2_screenshot_file).

I have a small problem though, I can't figure out how the display is setup, becouse it seems like the GS registers are write-only. So taking a screenshot becomes a little tricky becouse you need to manually specify: base-addr, width, height and bit-depth.

My questions:
- Would anyone be interested in an InLink replacement?
- Is a screenshot feature like this interesting for someone?
- What other features would you like?
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Mon May 04, 2009 9:38 pm    Post subject: Re: Taking screenshots with ps2link Reply with quote

Quote:
- Is a screenshot feature like this interesting for someone?
Would it be possible to take a screenshot at any time? That would be nice.
Quote:
- What other features would you like?
If you're modifying ps2link, please update the PAL/NTSC detection method to work with recent consoles. Check for detect_signal in recent gsKit sources.
You may also replace the ugly debug font. See http://forums.ps2dev.org/viewtopic.php?t=11663

---edited---

bah, the PAL/NTSC detection should be made at debug lib not at ps2link itself... My mistake.

BTW: Nice work with brickOS. Seems promising.
Back to top
View user's profile Send private message Visit poster's website
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Mon May 04, 2009 10:47 pm    Post subject: Reply with quote

Quote:
Would it be possible to take a screenshot at any time? That would be nice.
Yes, I've already made a few screenshots and they look great! But keep in mind that you need to manually specify where in GS memory to make the screenshot. So if an application uses double buffering and continuesly swaps the render-buffer with the display-buffer, only half of the screenshots will be from the display-buffer.

Quote:
If you're modifying ps2link
I would like to add the screenshot feature, but who is currently maintaining ps2link?
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Mon May 04, 2009 10:51 pm    Post subject: Reply with quote

Maximus32 wrote:
I would like to add the screenshot feature, but who is currently maintaining ps2link?

As far I know the current policy is to make a patch and post it over "forums.ps2dev.org Forum Index -> Patch Submissions". Some mod there will hopefully apply it.
Back to top
View user's profile Send private message Visit poster's website
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Tue May 05, 2009 5:15 am    Post subject: Reply with quote

you could make some common default rez and also add custom.

eg:
640x448
320x240
.....
.....
Set Manually
Back to top
View user's profile Send private message
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Tue May 05, 2009 7:31 am    Post subject: Reply with quote

@LionX: Good idea, I'll see what I can do.

As for the current status:
I found out taking screenshots when there is movement produces a mess. This is becouse the screenshot is taken and transferred line-by-line, while the application is still running in a different thread. To solve this I have to suspend all application threads, and resume them after the screenshot is taken.

I already have this working, but a lot of the applications I tested chash when suspending/resuming the threads.
The screenshot code is also very buggy: 16bit mode does not work at all, and a lot of applications/resolutions result in a crash. So perhaps I need to rewrite that part.

Anyway, here's some proof of the screenshots:

ps2dev tutorial 2a: (Looks good)


ps2dev tutorial 2b: (The text was moving, so it looks messed up!)


ps2dev tutorial 2d: (Captured the FRONT and BACK buffer at the same time)


All these images use double scan, so they should probably be stretched to make them look right.
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Tue May 05, 2009 12:03 pm    Post subject: Reply with quote

i could be wrong but i think the apps that crash is using a path to the GS other than path3(ee->gif->gs). or could be dma crash.
Back to top
View user's profile Send private message
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Sat May 09, 2009 8:35 am    Post subject: Reply with quote

I've uploaded a complete demo package. With it you should be able to make, and save your own screenshots. You can also suspend/resume the running application. Becouse it is all very experimental and a lot of applications do not work, I included a simple demo (ps2dev tutorial 2c) that does work, so give it a try, and let me know what you think.

[download] ~5MB

@LionX: The method used to make the screenshot differs from the one in the sony ps2linux manuals. So I think it crashes becouse registers are not setup/restored properly.
_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
LBGSHI



Joined: 07 Aug 2006
Posts: 136

PostPosted: Sat May 09, 2009 8:40 am    Post subject: Reply with quote

Wow, that's awesome :)

I'll test it out later.
_________________
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
misfire



Joined: 06 Sep 2004
Posts: 120
Location: Germany

PostPosted: Tue May 12, 2009 3:45 am    Post subject: Reply with quote

Good work.

Could you also add screenshot support to ps2client (for Linux people)?
Back to top
View user's profile Send private message
Maximus32



Joined: 27 Aug 2007
Posts: 41

PostPosted: Tue May 12, 2009 7:46 am    Post subject: Reply with quote

Quote:
Could you also add screenshot support to ps2client (for Linux people)?
The graphical interface will also be available "for Linux people". But if I have everything working properly I'll try to add screenshot support to ps2link as well.

Status update:
The screenshot code from the debug library wasn't working for me becouse it coused a lot of ps2 crashes. I found the graph_vram_read function in the graph library to be very usefull, though I had to modify it to be able to capture line-by-line. As a result, a lot more applications work now, including ps2link itself.
16bit screenshots are also working now (turns out there are 2 16bit modes, and I was only using one).
I also removed the conversion to 32bit (on the ps2 side). Making 16bit screenshots twice as fast, and 24bit screenshots 1.5x faster.

ConsoleLink, capturing ps2link:


Full-HD - 1920x1080, 16bit, dithering (click to enlarge):

_________________
Bricks-OS, Operating System for Game Consoles
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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