| View previous topic :: View next topic |
| Author |
Message |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Sat Jan 10, 2009 11:13 pm Post subject: Draw text on XMB |
|
|
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 |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Sun Jan 11, 2009 7:12 pm Post subject: |
|
|
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 |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Mon Jan 12, 2009 4:23 am Post subject: |
|
|
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 |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Jan 12, 2009 4:36 am Post subject: |
|
|
| 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 |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Mon Jan 12, 2009 8:56 am Post subject: |
|
|
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 |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Mon Jan 12, 2009 9:13 pm Post subject: |
|
|
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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Tue Jan 13, 2009 7:05 am Post subject: |
|
|
| 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 |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Tue Jan 13, 2009 11:56 pm Post subject: |
|
|
| 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 |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Wed Jan 14, 2009 4:01 am Post subject: |
|
|
| KickinAezz wrote: | | ...(4c 45 41 4b)! |
What did you mean? |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Wed Jan 14, 2009 4:36 am Post subject: |
|
|
| 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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Jan 14, 2009 8:56 am Post subject: |
|
|
| OldPrisoneR wrote: | | KickinAezz wrote: | | ...(4c 45 41 4b)! |
What did you mean? |
ASCII for L E A K. |
|
| Back to top |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Wed Jan 14, 2009 11:02 am Post subject: |
|
|
| 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 |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Wed Jan 14, 2009 11:43 am Post subject: |
|
|
| 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 |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Thu Jan 15, 2009 1:02 am Post subject: |
|
|
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 |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Thu Jan 15, 2009 1:50 am Post subject: |
|
|
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 |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Thu Jan 15, 2009 2:04 am Post subject: |
|
|
yes, thats helped, thx :) _________________ Pragramming with:
Microsoft Visual C 2008 + pspsdk MINPSPW 0.8.10 |
|
| Back to top |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Thu Jan 15, 2009 4:53 am Post subject: |
|
|
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 |
|
 |
OldPrisoneR
Joined: 20 Mar 2008 Posts: 53
|
Posted: Thu Jan 15, 2009 7:07 am Post subject: |
|
|
Use Gimp and plugin called RAWTex
(or Photoshop, but it'll work only with 32bit 8888 textures) |
|
| Back to top |
|
 |
hotter

Joined: 07 Dec 2008 Posts: 53
|
Posted: Sat Jan 17, 2009 12:49 am Post subject: |
|
|
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 |
|
 |
|