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 

Draw text on XMB

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



Joined: 07 Dec 2008
Posts: 53

PostPosted: Sat Jan 10, 2009 11:13 pm    Post subject: Draw text on XMB Reply with quote

Now I am using "VSHBlitter0.2" function "blit_string46" to draw text on XMB, but it sometimes makes my psp to crash, for example when I turn my psp to sleep and then on it crashes. And when I draw text atop (x=0 y=0) the text is blinking and it is hard to see it... why is that? is there any thing I can do to change it? or maybe I should use other way to draw text in XMB? is there better functions that are fully working?
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Sun Jan 11, 2009 7:12 pm    Post subject: Reply with quote

I found in google that I need to hook sceGuFinish. Can I hook it with a syscall patch? if so what these parameters are: sctrlHENFindFunction("???", "???", ???); ? I cant find these. any help?
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Mon Jan 12, 2009 4:23 am    Post subject: Reply with quote

You can blit anything to XMB without any hooks, you'll just need to setup GE in every display list you sent

You don't need to clear screen each time, cuz XMB will do it for you and you also don't need to setup framebuffer and draw region.

This sample will help you to understand better the concept:
http://foosa.do.am/MDL_SAMPLE.zip
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Jan 12, 2009 4:36 am    Post subject: Reply with quote

But thats user mode only. What about from kernel plugin? And from in-game user mode will usually crash with memory problems.
Back to top
View user's profile Send private message
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Mon Jan 12, 2009 8:56 am    Post subject: Reply with quote

The same thing but in kernel mode (for 5.00FW)
http://foosa.do.am/MDL_SAMPLE_KERNEL.rar

At real if you wanna make it compatible with games and especially with homebrew, you need use:
sceGeSaveContext();
sceGeRestoreContext();
in the signal and finish callbacks of your display list
Back to top
View user's profile Send private message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Mon Jan 12, 2009 9:13 pm    Post subject: Reply with quote

Thx for examples.
Well this is much better when "blit_string46", but text still sometimes blink, I guess when cpu usage is high... I will try it on my prx. Thx again.
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Jan 13, 2009 7:05 am    Post subject: Reply with quote

hotter wrote:
Thx for examples.
Well this is much better when "blit_string46", but text still sometimes blink, I guess when cpu usage is high... I will try it on my prx. Thx again.


The text will ALWAYS "blink" or flicker to some extent unless you hook one of the screen swap routines. That's because you can't count on when your text will be drawn, and it's just as likely to be right after the app swaps screens as any other time. The sooner after a swap you draw your text, the more likely it is to be overdrawn by the application running.
Back to top
View user's profile Send private message AIM Address
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Tue Jan 13, 2009 11:56 pm    Post subject: Reply with quote

OldPrisoneR wrote:
You can blit anything to XMB without any hooks, you'll just need to setup GE in every display list you sent

You don't need to clear screen each time, cuz XMB will do it for you and you also don't need to setup framebuffer and draw region.

This sample will help you to understand better the concept:
http://foosa.do.am/MDL_SAMPLE.zip


Way to let go of everything (4c 45 41 4b)!

-

Good Work?
_________________
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Back to top
View user's profile Send private message
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Wed Jan 14, 2009 4:01 am    Post subject: Reply with quote

KickinAezz wrote:
...(4c 45 41 4b)!

What did you mean?
Back to top
View user's profile Send private message
KickinAezz



Joined: 03 Jun 2007
Posts: 328

PostPosted: Wed Jan 14, 2009 4:36 am    Post subject: Reply with quote

OldPrisoneR wrote:
KickinAezz wrote:
...(4c 45 41 4b)!

What did you mean?


Nevertheless, we can see some interesting things in future.. better PRX plugins that donot depend on VRAM blitting, etc

GU acceleration by itself, is a great optimization.
_________________
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jan 14, 2009 8:56 am    Post subject: Reply with quote

OldPrisoneR wrote:
KickinAezz wrote:
...(4c 45 41 4b)!

What did you mean?


ASCII for L E A K.
Back to top
View user's profile Send private message AIM Address
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Wed Jan 14, 2009 11:02 am    Post subject: Reply with quote

Quote:
ASCII for L E A K.

^^
J.F., have you worked with save/restore GU context fuctions?
I wonder, where to put 'em to my code... to make context the same, after executing my display list.

I assume that whole thing must be something like this:
1. the first command of dlist must be a signal for saving
- In the signal handler I'll save GE context (and GE must wait while handler instructions are executed!)
2. the last command of dlist must be a signal for restoring
- In the signal handler I'll restore GE context (and again GE must wait while handler instructions are executed, that the reason we can't use finish handler - in its case GE won't stop)

Anyway that's just my assumption :)
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jan 14, 2009 11:43 am    Post subject: Reply with quote

OldPrisoneR wrote:
Quote:
ASCII for L E A K.

^^
J.F., have you worked with save/restore GU context fuctions?
I wonder, where to put 'em to my code... to make context the same, after executing my display list.

I assume that whole thing must be something like this:
1. the first command of dlist must be a signal for saving
- In the signal handler I'll save GE context (and GE must wait while handler instructions are executed!)
2. the last command of dlist must be a signal for restoring
- In the signal handler I'll restore GE context (and again GE must wait while handler instructions are executed, that the reason we can't use finish handler - in its case GE won't stop)

Anyway that's just my assumption :)


I've not worked on save/restore of the GE context, but yes, I'd say that the first thing is to SAVE and the last is to RESTORE. That seems like it would work better than the other way around. ;)
:D
Back to top
View user's profile Send private message AIM Address
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Thu Jan 15, 2009 1:02 am    Post subject: Reply with quote

I have a problem with this. If I edit your text from:
Code:

sprintf(buf,"Hi I'm 0x%x KERNEL ;)",(int)threadDisp);

to:
Code:

sprintf(buf,"Hi I'm 0x%x KERNEL ;) 123456789123456789",(int)threadDisp);

In psp I pres LTRIGGER and go to play video, then psp starts to beep and freezes. why does this happens?
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Thu Jan 15, 2009 1:50 am    Post subject: Reply with quote

This example packs vertexes into dlist, so as more characters you want to draw, as more dlist's size must be.
That means you probably should increase dlist's size (you can use sceGuCheckList to determine right size :)
Back to top
View user's profile Send private message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Thu Jan 15, 2009 2:04 am    Post subject: Reply with quote

yes, thats helped, thx :)
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Thu Jan 15, 2009 4:53 am    Post subject: Reply with quote

by the way how could I edit font.raw? is there any easy editing tool?
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
Back to top
View user's profile Send private message
OldPrisoneR



Joined: 20 Mar 2008
Posts: 53

PostPosted: Thu Jan 15, 2009 7:07 am    Post subject: Reply with quote

Use Gimp and plugin called RAWTex
(or Photoshop, but it'll work only with 32bit 8888 textures)
Back to top
View user's profile Send private message
hotter



Joined: 07 Dec 2008
Posts: 53

PostPosted: Sat Jan 17, 2009 12:49 am    Post subject: Reply with quote

I tryed gimp with that plugin but it can only save to raw file not to edit :(
I dont know how that font file should look like and with what settings it should be saved... any help?

EDIT: solved :P
_________________
Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10
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