Endless Paradigm

Full Version: {updated} XMB editing via coding?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Source: YouTube

This is just a small sample of what can be done with Alex's vlflib. Is anyone using vlf to create a theme? This could make some very nice XMB's, seeing you can do just about anything you like.

The vlf library is far from being finished, this could be like a 0.001 version :p and it is not prepared for a devs release, but...

Anyways here is the main program (resurrection.prx) source code that uses the vlf gui.

Some notes:

- vlf.prx contains the libc. To program using vlf gui your program has to use the vlf libc and not newlib/pspsdk libc, you have to use the included build.mak. For a normal application where you have the required prx's in your same directory(iop.prx, intraFont.prx and vlf.prx), you should modify the start_thread source code in crt0.c to the following one:

Code:
int start_thread(SceSize args, void *argp)
{
   SceUID mod;
   char *path = (char *)argp;
   int last_trail = -1;
   int i;

   if (path)
   {
      for (i = 0; path[i]; i++)
      {
         if (path[i] == '/')
            last_trail = i;
      }
   }

   if (last_trail >= 0)
      path[last_trail] = 0;

   sceIoChdir(path);
   path[last_trail] = '/';

   mod = sceKernelLoadModule("iop.prx", 0, NULL);
   mod = sceKernelStartModule(mod, args, argp, NULL, NULL);
   mod = sceKernelLoadModule("intraFont.prx", 0, NULL);
   mod = sceKernelStartModule(mod, args, argp, NULL, NULL);
   mod = sceKernelLoadModule("vlf.prx", 0, NULL);
   mod = sceKernelStartModule(mod, args, argp, NULL, NULL);
   vlfGuiInit(-1, app_main);
   
   return sceKernelExitDeleteThread(0); 


- Use the binaries from DC6 release.

- The heap size is passed as first parameter of vlfGuiInit. In this case -1 = all available. I think my version of the newlib is a bit old, so vlf.prx shouldn't support other negative values for the heap, just try anyways.
- The vlf libc currently only exports the following functions, as I was adding them to exports as I was needing them:

Code:
PSP_EXPORT_START(VlfLIBC, 0, 0x0001)
PSP_EXPORT_FUNC_NID(memcpy, 0x9BECFB07)
PSP_EXPORT_FUNC_NID(memset, 0xC37F286B)
PSP_EXPORT_FUNC_NID(memmove, 0x0B80B98F)
PSP_EXPORT_FUNC_NID(strcpy, 0x6FD77CF1)
PSP_EXPORT_FUNC_NID(strncpy, 0xAD1B8B78)
PSP_EXPORT_FUNC_NID(strcat, 0x785B4AD2)
PSP_EXPORT_FUNC_NID(strncat, 0x37816C4B)
PSP_EXPORT_FUNC_NID(strstr, 0x1189DEE4)
PSP_EXPORT_FUNC_NID(strchr, 0x71BD4392)
PSP_EXPORT_FUNC_NID(strrchr, 0xDE6B20E6)
PSP_EXPORT_FUNC_NID(printf, 0xEE062811)
PSP_EXPORT_FUNC_NID(sprintf, 0x90586B92)
PSP_EXPORT_FUNC_NID(snprintf, 0xCAEE18EE)
PSP_EXPORT_FUNC_NID(fprintf, 0xA48C1D67)
PSP_EXPORT_FUNC_NID(scanf, 0xDEFA2111)
PSP_EXPORT_FUNC_NID(sscanf, 0x7AD5E2FB)
PSP_EXPORT_FUNC_NID(fscanf, 0x18432C05)
PSP_EXPORT_FUNC_NID(strlen, 0x8CA6D7FA)
PSP_EXPORT_FUNC_NID(strnlen, 0x97627E33)
PSP_EXPORT_FUNC_NID(strcmp, 0x0D254CA5)
PSP_EXPORT_FUNC_NID(strncmp, 0x65AA73A2)
PSP_EXPORT_FUNC_NID(memcmp, 0x963F2271)
PSP_EXPORT_FUNC_NID(fopen, 0x72A04F8E)
PSP_EXPORT_FUNC_NID(fread, 0x352D1ECF)
PSP_EXPORT_FUNC_NID(fclose, 0xBC709C1A)
PSP_EXPORT_FUNC_NID(fwrite, 0x4F6D4257)
PSP_EXPORT_FUNC_NID(fgetc, 0x5F463703)
PSP_EXPORT_FUNC_NID(fputc, 0x577B6792)
PSP_EXPORT_FUNC_NID(memchr, 0x7003937A)
PSP_EXPORT_FUNC_NID(strcasecmp, 0xE5C7324A)
PSP_EXPORT_FUNC_NID(strncasecmp, 0xF992589C)
PSP_EXPORT_FUNC_NID(malloc, 0xAC773996)
PSP_EXPORT_FUNC_NID(memalign, 0x4BCFEC4C)
PSP_EXPORT_FUNC_NID(free, 0x8A93DF0A)
PSP_EXPORT_FUNC_NID(ftell, 0x710D2ED5)
PSP_EXPORT_FUNC_NID(fseek, 0x903689DE)
PSP_EXPORT_FUNC_NID(vsnprintf, 0x4B49491B)
PSP_EXPORT_FUNC_NID(atoi, 0xF6FF2554)
PSP_EXPORT_FUNC_NID(vsprintf, 0x13B380E2)
PSP_EXPORT_FUNC_NID(realloc, 0x8F770741)
PSP_EXPORT_FUNC_NID(__extendsfdf2, 0x285066C2)
PSP_EXPORT_FUNC_NID(__muldf3, 0x33FC8858)
PSP_EXPORT_FUNC_NID(__adddf3, 0x2812E321)
PSP_EXPORT_FUNC_NID(__truncdfsf2, 0x00616999)
PSP_EXPORT_END 


- vlf.h file has lot of things not commented yet, as it is not prepared for a release.
- Some functions won't work properly or won't work at all, some of them are just there for test.
- There is a lot of probabilities that I change a lot of the functions, and that it won't be compatible with new vlf versions. (for example those resources functions that I hate how they are).
- Objects have to be added/removed/modified in the drawing thread, otherwise you may get a bad drawing.
IF you are in thread X and you want to add/modify/remove an object you would do something like this:

Code:
int UpdateItems(void *param)
{
  // update items
  return VLF_EV_RET_REMOVE_HANDLERS;
}

int thread_X()
{
...
vlfGuiAddEventHandler(0, -1, UpdateItems, NULL);
...
} 


All event handlers are executed in the drawing thread just before drawing objects.

- The set background function has problems with the height of the image not being a divisor of 272.

- vlfGuiSystemSetup is a shortcut for typical initialization setup. It sets the background of the user, the waves (if not custom wallpaper), and adds a clock and a battery if the params are to 1. The "notuserwp" sepcify that if the user has a custom wallpaper, then it won't be used, but instead one of the predefined ones according to registry configuration.
BEcause there are problems with some user wallpapers of some sizes, it is better to set this param to 1 atm.

- vlfGuiSetResourceDir, sets the resources file directory, by default flash0:/vsh/resource.

- vlfGuiGetResourceSubParam... difficult to explain :) it is related to some subparams of resources where there are info on some xmb contents (like waves scale).

- vlfGuiLoadLabel loads a string from a resource in the current laguage (not that currently chinese, korean, and russian are not supported because of font, vlf sets its internal language variable to english when those language are detected). For example, loading the text of the network update title:

Code:
u16 str[64];

vlfGuiLoadLabel(str, "update_plugin", "msgtop_sysconf_update"); 


- The hideobj to 1 causes the objects within the area of the titlebar rectangle (e.g. battery and clock) to be hidden.
Which color are you using? try to set the alpha channel to 0xFF, 0xFFXXXXXX

- vlfGuiSetText returns 0 or an error if the text doesn't exist.

- vlfGuiRemoveTextFocus, keepres is used to indicate if the focus image resource is kept in memory to avoid further loading,

- nhide and nshow indicates the number of frames that the item is hidden and shown in the blink :) for example in the battery those params are set both to 30.

- The param mode can be VLF_FADE_MODE_IN, VLF_FADE_MODE_OUT, and VLF_FADE_MODE_REPEAT or an or combination of them, to cause a fade in, a fade out, and a repeated fade. When VLF_FADE_MODE_IN and VLF_FADE_MODE_OUT are specified at same time, the param direction_out indicates the initial direction. The effect param is one of VLF_FADE_EFFECT* constants, each one with a different speed.

Example, an infinite fading in+out triangle:

Code:
void *triangle;

vlfGuiAddTriangle(&triangle, 430, 50);
vlfGuiSetShadowedPictureFade(triangle, VLF_FADE_MODE_OUT | VLF_FADE_MODE_IN | VLF_FADE_MODE_REPEAT, VLF_FADE_EFFECT_STANDARD, 0); 


- It just sets text alignment to center left or right. Currently there is a problem if a text aligned to right has a text focus.

- vlfGuiChangeCharacterByButton is to replace a character by a button picture. For example, vlfGuiChangeCharacterByButton('*', VLF_ENTER); and then using vlfGuiAddText(10, 10, "Press *"); causes "Press (cross or circle pic)" to appear. Currently, doesn't workproperly with text sizes different to the default one, and only enter, cancel, cross, circle and triangle can be specified.

- vlfGuiSetPictureAlphaBlend, this is the alpha blend operation, you won't probably need this one. Parameters other than pic are same as the ones of sceGuAlphaBlend. It is used mostly by internal functions of vlf, as shadow pictures and normal pictures need a different alpha blend.

- vlfGuiClonePicture, creates a new picture which is a real copy of other (real=1) or a reference copy of other.

- fade is explained before. Animate picture functions take a picture and divde into pieces, each one will be a frame. w and h indicates the width and height of each piece, frames indicates the number of frames each image frame will be drawn.
Vertical indicates wether the image split is done vertically or horizontally.

- vlfGuiAddShadowedPicture just adds a shadowed picture :) A shadowed picture is a set of two pictures, one of them is the normal picture and the other is the shadow. The params sh_offsx and sh_offsy indicate the distance between the main picture and the shadow. shdow_before param tells vlf wether to paint before the shadow or no.

- Nop, no reasin in particular, just a mistake.

- The timer ms is the frequency of the timer that updates the battery.

- The VisibilityContext functions don't work still properly. They are meant to save and restore the context of the visiility state of objects in a rectangle,

- The rectangle blinking is to blink all objects in a rectangle. Not properly implemented yet. synchronized blinking is to synchronize the blinking of two objects.

- vlfGuiNetConfDialog is currently implemented using utility (that will change), i don't recomend its usage, it looks weird since is not painted same as in XMB. It returns the result of the utility dialog which i don't remember :)

- If automatic is set, button1 and button2 indicate the items (One of VLF_DI*) for the cancel and enter button. Otherwise, if automatic is 0, button1 is always the left, button2 always the right, and enter_is_left param indicate which of them is assigned to the enter button. distance indicates the position of the right button since the beginnig of the first one, or VLF_DEFAULT for a default. The handler is passed 1 if the enter button was pressed, or 0 if the cancel button was pressed.

Code:
#ifndef __VLF_H__
#define __VLF_H__

typedef int VlfText;
typedef int VlfPicture;
typedef int VlfProgressBar;
typedef int VlfSpin;
typedef void* VlfShadowedPicture;
typedef void *VlfBatteryIcon;


#define VLF_DEFAULT	-1

#define VLF_BATTERY_ICON_HIGH		0
#define VLF_BATTERY_ICON_MEDIUM		1
#define VLF_BATTERY_ICON_LOW		2
#define VLF_BATTERY_ICON_LOWEST		3

#define VLF_ERROR_INVALID_INPUT			(-1)
#define VLF_ERROR_INVALID_INPUT_DATA	(-2)
#define VLF_ERROR_UNSUPPORTED_FORMAT	(-3)
#define VLF_ERROR_OBJECT_OVERFLOW		(-4)
#define VLF_ERROR_OBJECT_NOT_FOUND		(-5)
#define VLF_ERROR_NO_MEMORY				(-6)
#define VLF_ERROR_SYSTEM				(-7)
#define VLF_ERROR_DUPLICATED			(-8)

/** Fade modes */
#define VLF_FADE_MODE_IN		1
#define VLF_FADE_MODE_OUT		2
#define VLF_FADE_MODE_REPEAT	4

/** Fade effect */
#define VLF_FADE_EFFECT_STANDARD	0
#define VLF_FADE_EFFECT_FAST		1
#define VLF_FADE_EFFECT_VERY_FAST	2
#define VLF_FADE_EFFECT_SLOW		3
#define VLF_FADE_EFFECT_SUPER_FAST	4


/* Alignment */
#define VLF_ALIGNMENT_LEFT			0
#define VLF_ALIGNMENT_CENTER	0x200
#define VLF_ALIGNMENT_RIGHT		0x400

enum VlfObjects
{
	VLF_TEXT = 0,
	VLF_PIC = 1,
	VLF_SHADOWED_PIC = 2,
	VLF_PROGRESS_BAR = 3
};

enum VlfButtonIcon
{
	VLF_ENTER = 0,
	VLF_CANCEL = 1,
	VLF_CROSS = 2,
	VLF_CIRCLE = 3,
	VLF_TRIANGLE = 4,
	VLF_SQUARE = 5
};

enum RCOType
{
	RCO_GRAPHIC,
	RCO_OBJECT,
	RCO_SOUND,
	RCO_LABEL,
	RCO_FILEPARAM,
	RCO_ANIMPARAM
};

enum VLF_MDType
{
	VLF_MD_TYPE_ERROR,
	VLF_MD_TYPE_NORMAL,
};

enum VLF_MD_Buttons
{
	VLF_MD_BUTTONS_NONE = 0,
	VLF_MD_BUTTONS_YESNO = 0x10,
};

enum VLF_MD_InitalCursor
{
	VLF_MD_INITIAL_CURSOR_YES = 0,
	VLF_MD_INITIAL_CURSOR_NO = 0x100,
};

enum VLF_MD_ButtonRes
{
	VLF_MD_NONE,
	VLF_MD_YES,
	VLF_MD_NO,
	VLF_MD_BACK
};

enum VLF_DialogItem
{
	VLF_DI_ENTER,
	VLF_DI_CANCEL,
	VLF_DI_BACK,
	VLF_DI_YES,
	VLF_DI_NO,
	VLF_DI_EDIT,
};

enum VLF_SpinState
{
	VLF_SPIN_STATE_NOT_FOCUS, // Spin control has not focus, buttons are not listened
	VLF_SPIN_STATE_FOCUS, // Spin control text has focus but arrow is not shown, buttons are not listened
	VLF_SPIN_STATE_ACTIVE, // Spin control has focus, and it is active  (arrows are shown, up and down buttons are listened)
};

#define VLF_EV_RET_NOTHING				0
#define VLF_EV_RET_REMOVE_EVENT			1 
#define VLF_EV_RET_REMOVE_OBJECTS		2
#define VLF_EV_RET_REMOVE_HANDLERS		4
#define VLF_EV_RET_REFRESH_ON_DELAY		8
#define VLF_EV_RET_DELAY				0x80000000 /* Delay VLF_EV_RET_DELAY | (X << 16), 0 <= X <= 32767 milisecs */


enum PspCtrlExtension
{
	PSP_CTRL_ENTER = 0x40000000,
	PSP_CTRL_CANCEL = 0x80000000
};

/**
 * Inits VLF library
*/
void vlfGuiInit(int heap_size, int (* app_main)(int argc, char *argv[]));

int  vlfGuiSystemSetup(int battery, int clock, int notuserwp);
int  vlfGuiGetLanguage();
void vlfGuiSetLanguage(int lang);
int  vlfGuiGetButtonConfig();
void vlfGuiSetButtonConfig(int config);
void vlfGuiSetResourceDir(char *dir);

/**
 * Performs the draw of the current frame
*/
void vlfGuiDrawFrame();

/**
 * Loads resources from a rco file
 *
 * @param rco - It can be one of following things:
 * - path relative to the flash0:/vsh/resource directory without extension (e.g. "system_plugin_bg")
 * - path relative to the flash0:/vsh/resource directory with extension (e.g. "system_plugin_bg.rco")
 * - path to a file (e.g. "flash0:/vsh/resource/system_plugin_bg.rco", "ms0:/myresfile.rco")
 *
 * RCO param is evaluated in the order given above, so if a rco file exists in current directory with name 
 * "system_plugin_bg.rco", it would load the one of flash0 and not the one of current directory. (in such a case, use "./system_plugin_bg.rco")
 * 
 * @param n - The number of resources to loads
 * @param names (IN) - An array with the names of resources
 * @param types (IN) - An array with the types of the resources (one of RCOType)
 * @param datas (OUT) - A pointer to a variable that will receive an array of pointers to the content of each resource,
 * or NULL if a specific resource has not been found.
 * Pointers returned are allocated with malloc, and should be deallocated by the application.
 *
 * @param sizes (OUT) - It will receive the sizes of the resources
 * @param pntable (OUT) - A pointer that will receive the string table. Pass NULL if no required.
 * Returned pointer is allocated with malloc and should be deallocated by the application.
 *
 * @returns - the number of resources loaded, or < 0 if there is an error.
 *
 * @Sample: Load battery icon pic and shadow
 *
 * char *names[2];
 * void *datas[2];
 * int types[2], sizes[2];
 *
 * names[0] = "tex_battery";
 * names[1] = "tex_battery_shadow";
 * types[0] = types[1] = RCO_GRAPHIC;
 *
 * int res = vlfGuiLoadResources("system_plugin_fg", 2, names, types, datas, sizes, NULL);
 * if (res != 2) // error or not all resources loaded
 * {
 *    if (res > 0)
 *    {
 *       if (datas[0])
 *          free(datas[0]);
 *       if (datas[1])
 *          free(datas[1]);
 *    }
 * }
 * else
 * {
 *    void *bat;    
 *    vlfGuiAddShadowedPicture(&bat, datas[0], sizes[0], datas[1], sizes[1], 441, 4, 1, 1, 1); 
 *    free(datas[0]);
 *    free(datas[1]);
 * }
 *
*/
int  vlfGuiLoadResources(char *rco, int n, char **names, int *types, void **datas, int *sizes, char **pntable);

int  vlfGuiCacheResource(char *rco);
int  vlfGuiUncacheResource(char *rco);


int  vlfGuiGetResourceSubParam(void *entry, int insize, char *ntable, char *name, void **data, int *size);


int  vlfGuiLoadLabel(u16 *str, char *rco, char *name);

/**
 * Sets the background from 8888 texture data
 *
 * @param texture - The texture data in 8888 format
 * @param width - The width of texture. Must be a power of 2.
 * @param height - The height of texture. Must be multiple of 8.
 * @param swizzled - Indicates if the texture is already in the psp GE fast texture format
 * @param scale_x - The x scale to apply
 * @param scale_y - The y scale to apply
 *
 * @returns 0 on success, or < 0 on error (params invalid)
*/
int  vlfGuiSetBackground(u32 *texture, int width, int height, int swizzled, float scale_x, float scale_y);

/**
 * Sets the background from a file buffer.
 * Supported formats are currently: BMP, TIM and GIM, with a depth of 24 or 32 bits.
 *
 * @param data - The buffer with the file data
 * @param size - The size of the data
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetBackgroundFileBuffer(void *data, int size);

/**
 * Sets the background from a file
 * Supported formats are currently: BMP, TIM and GIM, with a depth of 24 or 32 bits.
 *
 * @param file - Path to the file.
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetBackgroundFile(char *file);

/**
 * Sets one of system backgrounds based on the index.
 *
 * @param index - The index of the background, valid values are 1-27 
 * (note that 13-27 is only available on slim and will return an error on old psp)
 *
 * @returns 0 on success, < 0 on error
*/
int  vlfGuiSetBackgroundIndex(int index);

/**
 * Sets one of system backgrounds based on the current date
 *
 * @returns 0 on success, < 0 on error
*/
int  vlfGuiSetBackgroundDate();

/** 
 * Sets a background of a single color
 *
 * @param color - The color in XXBBGGRR format (XX is ignored).
 *
 * @returns - this functions always succeeds returning 0
*/
int  vlfGuiSetBackgroundPlane(u32 color);

/**
 * Sets the background according to the system configuration
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetBackgroundSystem(int notuserwp);

/**
 * Sets the system color, used in titlebars or menus
 *
 * @param index - the index of the color, 1-27
*/
void vlfGuiSetSystemColor(int index); 

/**
 * Sets the background model from a buffer.
 *
 * @param data - The buffer with the model in GMO format
 * @param size - The size of the model
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetModel(void *data, int size);

/**
 * Sets the background model from a file.
 *
 * @param file - The file with the model in GMO format
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetModelFile(char *file);

/**
 * Sets the background model from a resource.
 *
 * @param rco - The path to the RCO file
 * @param name - The name of the resource
 *
 * @returns - 0 on success, < 0 on error.
*/
int  vlfGuiSetModelResource(char *rco, char *name);

/**
 * Sets the background model of the system, and applies the proper world matrix to it.
 *
 * @returns 0 on success, < 0 on error.
*/
int  vlfGuiSetModelSystem();

/**
 * Sets the world matrix for the model. (by default, the world matrix is the identity 
 * after a model has been loaded, except when calling vlfGuiSetModelSystem).
 *
 * @param matrix - The matrix to set.
 *
 * @Sample: Load waves (this sample assumes the default scale of 8.5)
 *
 * int res = vlfGuiSetModelResource("system_plugin_bg", "mdl_bg");
 * if (res < 0) process_error;
 *
 * ScePspFMatrix4 matrix;
 * ScePspFVector3 scale;
 *
 * scale.x = scale.y = scale.z = 8.5f;
 * gumLoadIdentity(&matrix);
 * gumScale(&matrix, &scale);
 * vlfGuiSetModelWorldMatrix(&matrix);
*/
void vlfGuiSetModelWorldMatrix(ScePspFMatrix4 *matrix);

/**
 * Gets the world matrix of the model
 *
 * @returns a pointer to the model world matrix
*/
ScePspFMatrix4 *vlfGuiGetModelWorldMatrix();

/**
 * Sets the model speed 
 *
 * @param speed - The speed, default model speed is 1.0f/60.0f
*/
void vlfGuiSetModelSpeed(float speed);

void vlfGuiSetTitleBar(VlfText text, VlfPicture pic, int visible, int hideobj);
void vlfGuiSetTitleBarEx(VlfText text, VlfPicture pic, int visible, int hideobj, u32 color);
void vlfGuiSetTitleBarVisibility(int visible);

VlfText vlfGuiAddText(int x, int y, char *string);
VlfText vlfGuiAddTextW(int x, int y, wchar_t *string);
VlfText vlfGuiAddTextF(int x, int y, char *fmt, ...);
VlfText vlfGuiAddTextResource(char *rco, char *name, int x, int y);
int  vlfGuiRemoveText(VlfText text);
int  vlfGuiSetText(VlfText text, char *string);
int  vlfGuiSetTextW(VlfText text, wchar_t *string);
int  vlfGuiSetTextF(VlfText text, char *string, ...);
int  vlfGuiSetTextResource(VlfText text, char *rco, char *name);
int  vlfGuiSetTextFocus(VlfText text);
int  vlfGuiRemoveTextFocus(VlfText text, int keepres);
int  vlfGuiSetTextVisibility(VlfText text, int visible);
int  vlfGuiSetTextBlinking(VlfText text, u32 nshow, u32 nhide);
int  vlfGuiSetTextFade(VlfText text, int mode, int effect, int direction_out);
int  vlfGuiCancelTextFade(VlfText text);
int  vlfGuiSetTextFadeFinishCallback(VlfText text, void (* callback)(void *), void *param, int delay);
int  vlfGuiSetTextAlignment(VlfText text, int alignment);
int  vlfGuiSetTextXY(VlfText text, int x, int y);
int  vlfGuiSetTextSize(VlfText text, float size);
int  vlfGuiChangeCharacterByButton(u16 ch, int button);

VlfPicture vlfGuiAddPicture(void *data, int size, int x, int y);
VlfPicture vlfGuiAddPictureFile(char *file, int x, int y);
VlfPicture vlfGuiAddPictureResource(char *rco, char *name, int x, int y);
int  vlfGuiRemovePicture(VlfPicture pic);
int  vlfGuiSetPictureXY(VlfPicture pic, int x, int y);
int  vlfGuiGetPictureSize(VlfPicture pic, int *width, int *height);
int  vlfGuiSetPictureDisplayArea(VlfPicture pic, u32 x, u32 y, u32 width, u32 height);
int  vlfGuiSetPictureAlphaBlend(VlfPicture pic, int op, int src, int dst, u32 srcfix, u32 dstfix);
int  vlfGuiClonePicture(VlfPicture pic, int real, int x, int y);
int  vlfGuiSetPictureVisibility(VlfPicture pic, int visible);
int  vlfGuiSetPictureBlinking(VlfPicture pic, u32 nshow, u32 nhide);
int  vlfGuiAnimatePicture(VlfPicture pic, int w, int h, int frames, int vertical);
int  vlfGuiSetPictureFade(VlfPicture pic, int mode, int effect, int direction_out);
int  vlfGuiCancelPictureFade(VlfPicture pic);
int  vlfGuiSetPictureFadeFinishCallback(VlfPicture pic, void (* callback)(void *), void *param, int delay);

int  vlfGuiAddShadowedPicture(VlfShadowedPicture *sp, void *pic, int pic_size, void *shpic, int shpic_size, int x, int y, int sh_offsx, int sh_offsy, int shadow_before);
int  vlfGuiAddShadowedPictureFile(VlfShadowedPicture *sp, char *pic, char *shpic, int x, int y, int sh_offsx, int sh_offsy, int shadow_before);
int  vlfGuiAddShadowedPictureResource(VlfShadowedPicture *sp, char *rco, char *pic, char *shpic, int x, int y, int sh_offsx, int sh_offsy, int shadow_before);
int  vlfGuiRemoveShadowedPicture(VlfShadowedPicture sp);
int  vlfGuiSetShadowedPictureVisibility(VlfShadowedPicture sp, int visible);
int  vlfGuiSetShadowedPictureBlinking(VlfShadowedPicture sp, u32 nshow, u32 nhide);
int  vlfGuiAnimateShadowedPicture(VlfShadowedPicture sp, int w, int h, int ws, int hs, int frames, int vertical);
int  vlfGuiSetShadowedPictureFade(VlfShadowedPicture sp, int mode, int effect, int direction_out);
int  vlfGuiCancelShadowedPictureFade(VlfShadowedPicture sp);
int  vlfGuiSetShadowedPictureFadeFinishCallback(VlfShadowedPicture sp, void (* callback)(void *), void *param, int delay);

int  vlfGuiAddBatteryIcon(VlfBatteryIcon *baticon, u32 status, int blink);
int  vlfGuiAddBatteryIconEx(VlfBatteryIcon *baticon, int x, int y, u32 status, int blink);
int  vlfGuiAddBatteryIconSystem(VlfBatteryIcon *baticon, int timer_ms);
int  vlfGuiSetBatteryIconStatus(VlfBatteryIcon baticon, int status, int blink);
int  vlfGuiRemoveBatteryIcon(VlfBatteryIcon baticon);

int  vlfGuiAddClock();

int  vlfGuiAddWaitIcon(VlfShadowedPicture *waiticon);
int  vlfGuiAddWaitIconEx(VlfShadowedPicture *waiticon, int x, int y);

int  vlfGuiAddCross(VlfShadowedPicture *cross, int x, int y);
int  vlfGuiAddCircle(VlfShadowedPicture *circle, int x, int y);
int  vlfGuiAddTriangle(VlfShadowedPicture *triangle, int x, int y);
int  vlfGuiAddSquare(VlfShadowedPicture *square, int x, int y);
int  vlfGuiAddEnter(VlfShadowedPicture *enter, int x, int y);
int  vlfGuiAddCancel(VlfShadowedPicture *cancel, int x, int y);
int  vlfGuiAddSpinUp(VlfShadowedPicture *spinup, int x, int y);
int  vlfGuiAddSpinDown(VlfShadowedPicture *spindown, int x, int y);
int  vlfGuiAddArrowLeft(VlfShadowedPicture *arrowleft, int x, int y);
int  vlfGuiAddArrowRight(VlfShadowedPicture *arrowright, int x, int y);

int  vlfGuiAddGameIcon(VlfShadowedPicture *game, int x, int y);

VlfProgressBar vlfGuiAddProgressBar(int y);
VlfProgressBar vlfGuiAddProgressBarEx(int x, int y);
int  vlfGuiRemoveProgressBar(VlfProgressBar pb);
int  vlfGuiProgressBarSetProgress(VlfProgressBar pb, u32 perc);
int  vlfGuiSetProgressBarFade(VlfProgressBar pb, int mode, int effect, int direction_out);
int  vlfGuiCancelProgressBarFade(VlfProgressBar pb);
int  vlfGuiSetProgressBarFadeFinishCallback(VlfProgressBar pb, void (* callback)(void *), void *param, int delay);

int  vlfGuiSetRectangleVisibility(int x, int y, int w, int h, int visible);
void *vlfGuiSaveRectangleVisibilityContext(int x, int y, int w, int h);
void vlfGuiRestoreVisibilityContext(void *ctx);
void vlfGuiFreeVisibilityContext(void *ctx);

int  vlfGuiSetRectangleFade(int x, int y, int w, int h, int mode, int effect, int direction_out, void (* callback)(void *), void *param, int delay);
int  vlfGuiSetRectangleBlinking(int x, int y, int w, int h, u32 nshow, u32 nhide);
int  vlfGuiSetSynchronizedBlinking(void *dst, int dst_type, void *src, int src_type);

int  vlfGuiMessageDialog(char *msg, u32 flags);
int  vlfGuiErrorDialog(int error);
int  vlfGuiNetConfDialog();

int  vlfGuiBottomDialog(int button1, int button2, int automatic, int enter_is_left, int distance, int (* handler)(int enter));
int  vlfGuiCustomBottomDialog(char *button1, char *button2, int automatic, int enter_is_left, int distance, int (* handler)(int enter));
void vlfGuiCancelBottomDialog();

int  vlfGuiCentralMenu(int noptions, char **items, int defaultsel, int (* handler)(int sel), int dispx, int dispy);
void vlfGuiCancelCentralMenu();
int  vlfGuiCentralMenuSelection();

VlfSpin vlfGuiAddIntegerSpinControl(int x, int y, int min, int max, int cur, int step, int loop, int speed, int initstate, char *prefix, char *suffix);
int  vlfGuiRemoveSpinControl(VlfSpin spin);
int  vlfGuiSetSpinState(VlfSpin spin, int state);
int  vlfGuiSetIntegerSpinMinMax(VlfSpin spin, int min, int max);
int  vlfGuiGetIntegerSpinValue(VlfSpin spin, int *value);
int  vlfGuiSetIntegerSpinValue(VlfSpin spin, int value);

int  vlfGuiPreviousPageControl(int (* handler)(int page));
int  vlfGuiNextPageControl(int (* handler)(int page));
void vlfGuiCancelPreviousPageControl();
void vlfGuiCancelNextPageControl();
void vlfGuiSetPageControlEnable(int enable);

int  vlfGuiAddEventHandler(int buttons, int wait, int (* func)(void *), void *param);
int  vlfGuiAddNegativeEventHandler(int buttons, int wait, int (* func)(void *), void *param);
int  vlfGuiRemoveEventHandler(int (* func)(void *));
int  vlfGuiRemoveEventHandlerEx(int (* func)(void *), void *param);
int  vlfGuiIsEventRegistered(int (* func)(void *));
int  vlfGuiSetEventDelay(int (* func)(void *), u32 delay);
int  vlfGuiSetEventDelayEx(int (* func)(void *), void * param, u32 delay);
int  vlfGuiDelayAllEvents(u32 delay);


#endif


Code:
#include <pspsdk.h>
#include <pspkernel.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


PSP_MODULE_INFO("VshLoader", 0x1000, 1, 0);

int stop_thread(SceSize args, void *argp)
{
	SceModule *module;
	SceUID mod;

	sceKernelDelayThread(200000);
	
	while ((module = sceKernelFindModuleByName(argp)) != NULL)
	{
		sceKernelStopModule(module->modid, 0, NULL, NULL, NULL);
		sceKernelUnloadModule(module->modid);
		sceKernelDelayThread(10000);
	}

	mod = sceKernelLoadModule("flash0:/vsh/module/vshmain_real.prx", 0, NULL);
	sceKernelStartModule(mod, 0, NULL, NULL, NULL);

	sceKernelStopUnloadSelfModule(0, NULL, NULL, NULL);
	return sceKernelExitDeleteThread(0); // should not arrive here
}

int module_start(SceSize args, void *argp)
{
	SceUID thid = sceKernelCreateThread("stop_thread", stop_thread, 0x14, 0x4000, 0, NULL);
	sceKernelStartThread(thid, args, argp);

	return 0;
}

int module_stop(SceSize args, void *argp)
{
	return 0;
}

that looks amazing! i knew the xmb wave was a 3d model, but i never seen it quite like this! it would be neat to replace the 3d model with say, a model of an anime character or something, that had animations in the model data.. and it would dance to caramel dansen all day (^__^)
Jomann Wrote:that looks amazing! i knew the xmb wave was a 3d model, but i never seen it quite like this! it would be neat to replace the 3d model with say, a model of an anime character or something, that had animations in the model data.. and it would dance to caramel dansen all day (^__^)

That would take up a lot of RAM, but yes I get what you are saying.

I'm very sorry, but I did not know the part of the forum was linked to the portal. This is not news just a question, could this be moved please Emptyone

thanks
Nah it's fine.

Is there more info on this?
I've recently found some things in RCOs which may actually make this possible with RCOs (but I've really never tried it obviously).  There's a "rotation" command, as well as scaling commands in the animations section.

Nevertheless, sounds pretty interesting :P
ZiNgA BuRgA Wrote:Nah it's fine.

Is there more info on this?
I've recently found some things in RCOs which may actually make this possible with RCOs (but I've really never tried it obviously).  There's a "rotation" command, as well as scaling commands in the animations section.

Nevertheless, sounds pretty interesting :P

Everything you would ever want to know about this.

I posted all the lib's, the only thing you do not get is source for is the vlf.prx, but hey.. that's why wee have prxtool :P
Gah, I see you edited the post (should've looked beforehand), sorry.
ZiNgA BuRgA Wrote:Gah, I see you edited the post (should've looked beforehand), sorry.

No, you correct. I edited the posted after you asked for more info.
ZiNgA BuRgA Wrote:Nah it's fine.

Is there more info on this?
I've recently found some things in RCOs which may actually make this possible with RCOs (but I've really never tried it obviously).  There's a "rotation" command, as well as scaling commands in the animations section.

Nevertheless, sounds pretty interesting :P

you mean to say that: the XMB rco's are the same as the UMD rco's,.!?

i am guessing you were not able to spot these entry's in the XMB because they were not used in XMB rco's!?

The 3d wave model would look so cuul responding to music!!
Vegetano1 Wrote:you mean to say that: the XMB rco's are the same as the UMD rco's,.!?

i am guessing you were not able to spot these entry's in the XMB because they were not used in XMB rco's!?

The 3d wave model would look so cuul responding to music!!

I like this one better.

Source: YouTube
this is preety sik duude
Pages: 1 2
Reference URL's