| View previous topic :: View next topic |
| Author |
Message |
kweensey
Joined: 29 Jan 2009 Posts: 26
|
Posted: Thu Jan 29, 2009 7:53 pm Post subject: [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 |
|
| Back to top |
|
 |
hibbyware
Joined: 28 Mar 2007 Posts: 78
|
|
| Back to top |
|
 |
kweensey
Joined: 29 Jan 2009 Posts: 26
|
Posted: Fri Jan 30, 2009 2:53 am Post subject: |
|
|
| Solved. Lock, please. |
|
| Back to top |
|
 |
Ooblik
Joined: 10 Apr 2008 Posts: 38
|
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Thu Jul 23, 2009 5:13 am Post subject: |
|
|
| Where do i have to put the blit.h, blit.c so i can compile ? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Jul 23, 2009 6:08 am Post subject: |
|
|
| zydeoN wrote: | | Where do i have to put the blit.h, blit.c so i can compile ? |
Same place as your other .c and .h files. ;)
Don't forget to add blit.c to the makefile (normally as blit.o in the OBJS = line). |
|
| Back to top |
|
 |
Dariusc123456
Joined: 12 Aug 2008 Posts: 394
|
Posted: Thu Jul 23, 2009 6:17 am Post subject: |
|
|
Also there's a tutorial at psp-hacks.com forums about placing text onto the xmb screen using blit.h and blit.c. Useful tutorial for someone like you. _________________ PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ? |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Thu Jul 23, 2009 8:00 am Post subject: |
|
|
| Solved, i was not putting the blit.c right away. Anyway, the path to the two files are psp/sdk/include |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Thu Jul 23, 2009 9:04 am Post subject: |
|
|
| zydeoN wrote: | | Solved, i was not putting the blit.c right away. Anyway, the path to the two files are psp/sdk/include |
Now i canīt display anything on xmb, although it is compiling well. Here is the code:
| Code: | #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;
} |
What am i doing wrong ? |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Thu Jul 23, 2009 1:04 pm Post subject: |
|
|
| I use FF000000 and FFFFFFFF for my colors as some text routines won't draw the text if the alpha value is 0. |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Fri Jul 24, 2009 12:55 am Post subject: |
|
|
| Solved again... I had to put 0x18 on createThread in module_start, instead of 0x30. |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Sat Jul 25, 2009 12:31 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Wed Jul 29, 2009 6:50 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Jul 29, 2009 3:10 pm Post subject: |
|
|
| 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). |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Thu Jul 30, 2009 5:11 am Post subject: |
|
|
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:
| Code: |
int fd = sceIoOpen("ms0:/font.raw", PSP_O_RDONLY, 0777);
if(fd >= 0)
{
sceIoRead(fd, font, 0x20000);
sceIoClose(fd);
} else return 0; |
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] |
|
| Back to top |
|
 |
|