forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[PRX] How to print text over the XMB?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
kweensey



Joined: 29 Jan 2009
Posts: 26

PostPosted: Thu Jan 29, 2009 7:53 pm    Post subject: [PRX] How to print text over the XMB? Reply with quote

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
View user's profile Send private message
hibbyware



Joined: 28 Mar 2007
Posts: 78

PostPosted: Fri Jan 30, 2009 12:04 am    Post subject: Reply with quote

http://code.google.com/p/powermgrprx/source/browse/#svn/trunk

Take a look at blit.h/c in the contrib directory,
Back to top
View user's profile Send private message
kweensey



Joined: 29 Jan 2009
Posts: 26

PostPosted: Fri Jan 30, 2009 2:53 am    Post subject: Reply with quote

Solved. Lock, please.
Back to top
View user's profile Send private message
Ooblik



Joined: 10 Apr 2008
Posts: 38

PostPosted: Wed Feb 04, 2009 3:20 am    Post subject: Reply with quote

If you have trouble finding it like I did at first:
http://powermgrprx.googlecode.com/svn/trunk/contrib/

Now this can be Locked :)
Back to top
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Thu Jul 23, 2009 5:13 am    Post subject: Reply with quote

Where do i have to put the blit.h, blit.c so i can compile ?
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jul 23, 2009 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Dariusc123456



Joined: 12 Aug 2008
Posts: 394

PostPosted: Thu Jul 23, 2009 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Thu Jul 23, 2009 8:00 am    Post subject: Reply with quote

Solved, i was not putting the blit.c right away. Anyway, the path to the two files are psp/sdk/include
Back to top
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Thu Jul 23, 2009 9:04 am    Post subject: Reply with quote

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
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jul 23, 2009 1:04 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Fri Jul 24, 2009 12:55 am    Post subject: Reply with quote

Solved again... I had to put 0x18 on createThread in module_start, instead of 0x30.
Back to top
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Sat Jul 25, 2009 12:31 am    Post subject: Reply with quote

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
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sat Jul 25, 2009 7:02 pm    Post subject: Reply with quote

zydeoN 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


Software blit image (pure kernel; safe for in-game use): http://forums.ps2dev.org/viewtopic.php?t=11289&highlight=blit

GU blit image (kernel with list in user mem; NOT safe in-game, OK in XMB): http://foosa.do.am/MDL_SAMPLE_KERNEL.rar
Back to top
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Wed Jul 29, 2009 6:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Wed Jul 29, 2009 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Thu Jul 30, 2009 5:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group