[PRX] How to print text over the XMB?
[PRX] How to print text over the XMB?
Hey,
I'm making a PRX plugin and I want to print some text over the XMB or game.. I heard something about piKey's source code but I found nothing.
Could you tell me how to write text with PRX plugin or give me some source code where it is used, please?
Thank you.
kweensey
I'm making a PRX plugin and I want to print some text over the XMB or game.. I heard something about piKey's source code but I found nothing.
Could you tell me how to write text with PRX plugin or give me some source code where it is used, please?
Thank you.
kweensey
http://code.google.com/p/powermgrprx/so ... #svn/trunk
Take a look at blit.h/c in the contrib directory,
Take a look at blit.h/c in the contrib directory,
If you have trouble finding it like I did at first:
http://powermgrprx.googlecode.com/svn/trunk/contrib/
Now this can be Locked :)
http://powermgrprx.googlecode.com/svn/trunk/contrib/
Now this can be Locked :)
-
- Posts: 388
- Joined: Tue Aug 12, 2008 12:46 am
Now i can´t display anything on xmb, although it is compiling well. Here is the code:zydeoN wrote:Solved, i was not putting the blit.c right away. Anyway, the path to the two files are psp/sdk/include
Code: Select all
#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspkernel.h>
#include <psppower.h>
#include <pspsdk.h>
#include <pspdisplay_kernel.h>
#include "contrib/blit.h"
#include "contrib/blit.c"
#define FGCOLOR 0xFFFFFF //Foregorund color is pure white
#define BGCOLOR 0x000000 //Background color is pure black
PSP_MODULE_INFO("poweroff", 0x1000, 1, 0);
PSP_MAIN_THREAD_ATTR(0);
SceCtrlData pad;
int info = 0;
void informacoes()
{
info=1;
while(info==1)
{
blit_string(0,0,"Informacoes");
sceDisplayWaitVblankStart();
sceCtrlPeekBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_SELECT) info=0;
}
}
int main_thread(SceSize args, void *argp)
{
blit_setup();
blit_set_color(FGCOLOR,BGCOLOR);
while(1) // loop is required so buttons get checked more than ONCE
{
sceCtrlPeekBufferPositive(&pad, 1); // update the var inside the loop
if(pad.Buttons & PSP_CTRL_SELECT) informacoes();
if((pad.Buttons & PSP_CTRL_LTRIGGER) && (pad.Buttons & PSP_CTRL_UP)) scePowerRequestSuspend(); //
sceKernelDelayThread(100000);// don't use processor for around 1/10 of a second
}
return 0;
}
int module_start(SceSize args, void *argp)
{
// Create a thread
int thid = sceKernelCreateThread("poweroff", main_thread, 0x30, 0x1000, 0, NULL); // 0x30 thread priority lower is higher, 0x1000 initial stack size
if(thid >= 0)
sceKernelStartThread(thid, args, argp);
return 0;
}
Software blit image (pure kernel; safe for in-game use): http://forums.ps2dev.org/viewtopic.php? ... light=blitzydeoN wrote:Now im trying to blit images on XMB. Does anyone here have the sources of the vshblitter. I searched the net, but all links are corrupted... Ive heard about GU in XMB but, i dont know anything about GU
GU blit image (kernel with list in user mem; NOT safe in-game, OK in XMB): http://foosa.do.am/MDL_SAMPLE_KERNEL.rar
i found vshblitter, but cannot compile it in kernel mode if i used
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
I tried without those and it compiled but the prx didnt work, so i will try the links you gave me..
EDIT: Tried the first one, but it is the same. I think the problem here is when i am loading PNG
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
I tried without those and it compiled but the prx didnt work, so i will try the links you gave me..
EDIT: Tried the first one, but it is the same. I think the problem here is when i am loading PNG
My code in the first link is only for blitting RAW 8888 data. You need to use libPNG to decompress the image first. However doing this in kernel mode will take up 100s of KiB of space dynamically and isn't recommended at all. Its better you store the RAW 8888 images directly (either embedded or on the memory stick(better)). You can use GIMP to export to RAW 8888 (non-swizzled).
I installed GIMP 2.6 and saved as raw image (ourImage.raw) But cannot open this format with gimp, shouldnt this be possible? Btw, how can i store the RAW image either on MS or embedded?
Do i have to do something like that:
This was on MDL_SAMPLE_KERNEL
EDIT: Solved, i had to use bin2c on this.
Now im trying to blit the image in xmb with the info in the first link Torch gave, but im getting a bunch of errors when i compile. Here is the source: http://codepad.org/FibsnSb2
Compiling errors:
It is only getting problems with vram16 and not with vram32 and both in function drawimage() turn into vram16[offset] and vram32[offset]
Do i have to do something like that:
Code: Select all
int fd = sceIoOpen("ms0:/font.raw", PSP_O_RDONLY, 0777);
if(fd >= 0)
{
sceIoRead(fd, font, 0x20000);
sceIoClose(fd);
} else return 0;
EDIT: Solved, i had to use bin2c on this.
Now im trying to blit the image in xmb with the info in the first link Torch gave, but im getting a bunch of errors when i compile. Here is the source: http://codepad.org/FibsnSb2
Compiling errors:
It is only getting problems with vram16 and not with vram32 and both in function drawimage() turn into vram16[offset] and vram32[offset]