Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scea.yaroze.programming.2d_graphics,scee.yaroze.programming.2d_graphics Subject: Re: Scrolling without BG ?? Date: Wed, 28 May 1997 10:22:36 +0100 Organization: Sony Computer Entertainment Europe Lines: 55 Message-ID: <338BF95C.12A@interactive.sony.com> References: <5mgje6$shk7@scea> Reply-To: N/A-Use-Newsgroup NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Xref: chuka.playstation.co.uk scea.yaroze.programming.2d_graphics:68 scee.yaroze.programming.2d_graphics:101 George Bain wrote: > > Is it possible to scroll a background without BG? What I'am trying to do > on the PlayStation is scroll two 160*240 images...just a simple wrap around. > I tried some things out but I loose the image when I wrap around. The image > would be useless to break down into 16*16 tiles so I need another way. > If this is not possible or anyone know of hints or tricks please let me know. > > P.S. Does anyone...anyone..know how to use the system timers? > > Latah.... > > George Bain If you draw 4 images then you'll have no problems. Draw the first one at your (x,y), remember to do a x %= 320, y %= 256 (or what ever your screen resolution is). Then draw then others at (x-320,y) (x,y-256) and (x-320,y-256) (again depends on your screen resolution). Its not ideal but will do the job. As for system timers there are 3 functions long StartRCnt(unsigned long), long ResetRCnt(unsigned long) and long GetRCnt(unsigned long). The only values that do anything in the calls are 0,1 and 2. 0 and 2 seem to be pixel counts (time to draw a pixel, or of that order, there isn't much in the way of details on how they were set up), and 1 seems to be a scanline count. To use the root counters just call StartRCnt with the number you want. ResetRCnt as necessary and GetRCnt to get a value. The value returned is in the range 0-65535, after which the counters wrap around. Example #include void main() { unsigned long counter; counter = 0; // could also be 1 or 2 StartRCnt(counter); while(*program terminate condition*) { ResetRCnt(counter); *all the code* printf("Time taken: %d\n",GetRCnt(counter)); } } Stuart