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 

Clearing the screen

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



Joined: 07 Aug 2006
Posts: 136

PostPosted: Mon Jan 19, 2009 3:04 pm    Post subject: Clearing the screen Reply with quote

Without using any specific graphics libraries (gsKit, gsLib, etc), I'd like to clear the screen in a little better way than I currently am.

I started out using init_screen(), but, noting the delay, tried replacing it with scr_clear(). To my dismay, this actually made the delay longer.

Is there another way I might clear the screen? And, any idea why clearing the screen would take longer than initializing it? That makes me question the usefulness of clear_scr at all...

Alternately, I suppose I could just accept using a graphics lib (I'll eventually do that anyway), if someone could point out a quick way to clear the screen in one.

Thanks in advance for any help.
_________________
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jbit
Site Admin


Joined: 28 May 2005
Posts: 293
Location: København, Danmark

PostPosted: Mon Jan 19, 2009 6:50 pm    Post subject: Reply with quote

scr_clear() does not do what you think it does, it's part of the debug text library and basically draws lots and lots of blank characters on screen. And each character draw is doing it's very own DMA operations IIRC. So it's extremely slow. The functions you are using are not designed for interactive programs, they're designed for randomly throwing text on the screen in a reliable way regardless of current system state.

gskit has something like gsKit_clear(); which I'm pretty sure uses strips to clear the screen instead of one big sprite. But you'll need to init gsKit, etc before using it of course.

To clear the screen really really fast you need to use strips, if you just use one sprite the size of the screen you hit a million GS page cache misses and it becomes very very slow, if you use lots of 64pixel wide sprite strips you avoid any page cache misses on the horizontal scanning, so you pretty much hit the GS' peak pixel fill rate (which is fast, even by todays standards)
Back to top
View user's profile Send private message Visit poster's website
LBGSHI



Joined: 07 Aug 2006
Posts: 136

PostPosted: Tue Jan 20, 2009 1:39 am    Post subject: Reply with quote

OK, so utilize gsKit :) Thanks.
_________________
I may be lazy, but I can...zzzZZZzzzZZZzzz...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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