Also, no offence, but this function is already implemented in libpng.
This line alone will take a screenshot:
saveImage("Screenshot.png", getVramDisplayBuffer(), SCREEN_WIDTH, SCREEN_HEIGHT, PSP_LINE_SIZE, 0);
I use the following code in AniMate to take screenshots when select is pressed.
[EDIT] Damn letter count limit in posts....
Link to Code:
http://www.psp-programming.com/animate/screenshotcode.htmAlso you need to initialise the ScreenShotNumber variable somewhere at the start of your program with:
int ScreenShotNumber = 0;
The above code will auto-increment the screenshot number -- and unlike some other code snippets, will not overwrite any existing files (for example from a previous day of playing the game).
This code follows the KISS principal
