why pspDebugScreenPrintf + gu = blinking text?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
w.kosma
Posts: 19
Joined: Fri Oct 28, 2005 11:33 pm

why pspDebugScreenPrintf + gu = blinking text?

Post by w.kosma »

hi,

i`m having a problem with blinking text after printing using pspDebugScreenPrintf together with gu functions,

i had a look in /samples/gu/logic, where it works fine, and did everything in the same way, but the bug didn`t dissapear,

is there any particualr reason for that?

sorry for not posting the code, but it`s very messy,

i`ll be grateful for any advices,

thanks,
wojciech
sandberg
Posts: 90
Joined: Wed Oct 05, 2005 1:25 am
Location: Denmark

Post by sandberg »

Sounds like a doublebuffer problem, i.e. that you only have your text printed on one of the buffers and not both.

The source would help to pinpoint the problem.
Br, Sandberg
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Post by sg57 »

I have had the same problem, so I just print what ever before the flipScreen();, or I just use this:

Code: Select all

// You need graphics.h
printTextToScreen(posx, posy, const char string, u32 color*);
flipScreen();
And if you need an integer in it, or any other buffer inside of it:

Code: Select all

char TextBuff[200];
sprintf(TextBuff, " %i/%s/%d etc.", int/array/etc.);
printTextToScreen(TextBuff);
flipScreen();
If you have a boolean that points to printing the text or whatever you want when something happens (A Pause menu for example), just print the text off screen until the time has come:

Code: Select all

#define TRUE    1
char TextBuff[200];
int pause = 0;
int textX = 273; //The text will be off screen
int textY = 136; //the text will be in the right Y co-ord spot though
sprintf(TextBuff, " %i/%s/%d etc.", int/array/etc.);  /*Feed the text intoa ----------------------------------------------------------->Buffer*/
printTextToScreen(textX, textY, TextBuff, RGB(0, 255, 0)); //Print Text to Screen
flipScreen();

if(SceCtrlData.Buttons & PSP_CTRL_START) { //Start = Pause
     pause = TRUE;                        
} else if(pause==TRUE) {   //If pause is true
     textX = 230;
}
This would print the text on to the screen, but off to the right hand side by 1 pixel, until START is pressed, and PAUSE mode is initiated, thus meaning what ever you had sprintf(); do/display, display it right in the middle of the screen in the color Green.

if I made any mistakes, it's because I'm in a hurry, but they are all minor if there are any...
User avatar
ReKleSS
Posts: 73
Joined: Sat Jun 18, 2005 12:57 pm
Location: Melbourne, Australia

Post by ReKleSS »

w.kosma: I don't know what your specific problem is, but pspDebugScreenPrintf is, as its name would suggest, meant for debugging. It's writing directly to what it thinks is the video ram (not the back buffer), and that probably conflicts with whatever the GU is doing. You probably want to find a cleaner way of printing text.
-ReK
w.kosma
Posts: 19
Joined: Fri Oct 28, 2005 11:33 pm

Post by w.kosma »

thanks,

i really appreciate your advices,

Mr ReKleSS - all the examples i found use pspDebugScreenPrintf in conjunction with gu,
what is the cleaner way of doing this?

thanks,
wojciech
User avatar
Conflict
Posts: 8
Joined: Wed May 11, 2005 9:00 am
Location: UK, York

Post by Conflict »

a good way would be to render to GU_PROJECTION matrix mode and sceGumOrtho (....), such as a bitmap font drawing poly quads (2 tris) for each char, instead of bitblt'ing the chars directly into (v/eram)?

pretty much a universal method, do some research on how bitmap fonts are achieved in opengl, which will pretty much transfer across to the sce API, looking at the functions available and required.

"bitmap font opengl" in googly is a good place to start

if i have some time later i may try and knock up a sample, but it shouldn't be to difficult looking at it.

lee
<,<;
Post Reply