View Full Version : Lib SDK Utilities v0.2

March 25th, 2008, 21:51
News/release from dridri85 (http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=3347)

The LibSdkUtilities allows you to use the utility official sdk following:

Keys OSK
Message Dialog (with choice "Yes \ No" possible)
Error Dialog (it displays an error code)
Net Dialog (maleureusement the connection is cut off at the end ...

Voila functions as such:
SceSetBackgroundColorUtility (u32 color) / / Set the background color

Void sceSetBackgroundImageUtility (u32 * data, int width, height int) / / Select the background image
Data => array of pixels
For the libpng or my libge is mon_image-> data
SDL for it is surely mon_image-> pixels
For OSlib no idea ...
Width and height => width and height in pixels, image

Void sceOsk (const char * msg, char * input) / / Keys osk
Msg => message display (bottom right)
Input => Text Input / output

SceSaveData void (* sData save) / / loading system backup
See structure sData lowest

Int sceMessageDialog (const char * message, enableYesno int, int baseAwn)
Message => Message Display
enableYesno => activer le mode question (choix "Oui/Non")
baseAwn => Valeur par défaut si question, 1 pour Oui, 0 pour Non

Void sceErrorDialog (const unsigned int error)
Error => hexadecimal value on 32bits will be shown as error

Void sceNetDialog (int language, buttonSwap int)
Language => Language (0 English, french 1)
ButtonSwap => vice X and O, 1 normal, inverted 0

/ / Structure sData for savedata:
Typedef struct (
Int mode; / / Fashion save / load
Int language; / / 2 for french Language
Int buttonSwap / / Reverse buttons
Char * title1, title2 * / / name of the game; name of the backup (eg "Community Profile")
Char * gameName, saveName * / / Code name of the game; figures backup
/ / Both values are set as a result of naming the backup folder (eg "DEMO1030")
Char * newSave / / display a text on a blank sauvergade
Char * details; / / Things that will be posted as details (eg "% of the game done: 42%"), returns a line possible
Void * buf; / / Buffer containing a register values (often text)
Int bufSize / / size of the buffer
Char * key; / / Key encryption (for PSP and 2.0 +)
Void * icon, pic * / / For the moment is a waste of time ...

/ / Small detail for the buffer, we must do a malloc and ex memset:
SData save;
Int len = strlen (score = 25 ") +1; / / Calculating the size of the text
Save.bufSize len = 4 * / / Gives the size sData
Save.buf = malloc (sizeof (char) * len); Setting memory buffer (text)
Memset (save.buf, 0, len); / / Fill in the memory area of 0
Strcpy (save.buf, "score = 25 ");// Written text in the buffer

If you are load mode:
- Responsible values will be returned in the structure sData!
It must have previously made an on sData.buffer malloc (and therefore give the value bufSize)!

To use include:
And add it to the line of LIBS makefile:
- LSdkUtilities

Download v0.2: http://www.zshare.net/download/927633305eb25f/
The files are arranged in the order of pspdev
Eboot an example (from v0.2): http://www.zshare.net/download/92762651e5fe0e/
A place in ms0: / PSP / GAME / comme_vous_voulez ^ ^ /
Add a side of an image 480 * 272 named image.png