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 

why pspDebugScreenPrintf + gu = blinking text?

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



Joined: 28 Oct 2005
Posts: 19

PostPosted: Sat Feb 18, 2006 4:21 am    Post subject: why pspDebugScreenPrintf + gu = blinking text? Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
sandberg



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Sat Feb 18, 2006 6:30 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Sat Feb 18, 2006 9:21 am    Post subject: Reply with quote

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

Code:

// 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:

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:

#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...
Back to top
View user's profile Send private message
ReKleSS



Joined: 18 Jun 2005
Posts: 73
Location: Melbourne, Australia

PostPosted: Sat Feb 18, 2006 9:43 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
w.kosma



Joined: 28 Oct 2005
Posts: 19

PostPosted: Sat Feb 18, 2006 9:18 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Conflict



Joined: 11 May 2005
Posts: 8
Location: UK, York

PostPosted: Mon Feb 20, 2006 4:30 am    Post subject: Reply with quote

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
_________________
<,<;
Back to top
View user's profile Send private message MSN Messenger
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