Path: chuka.playstation.co.uk!news From: "Andrew Partington" Newsgroups: scee.yaroze.freetalk.english Subject: Re: work in progress demo Date: Sun, 22 Jul 2001 22:03:51 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 55 Message-ID: <9jfeic$5fk2@www.netyaroze-europe.com> References: <9j7hfs$qcd2@www.netyaroze-europe.com> <9j95n4$sk21@www.netyaroze-europe.com> <9jalov$df1@www.netyaroze-europe.com> <9jc7nh$df3@www.netyaroze-europe.com> NNTP-Posting-Host: modem-241.calcium.dialup.pol.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Thanks for the help Martin, that's sped things up quite a bit - i'm saving around 20-25 hsyncs/frame now! The map size is now a multiple of 2 so there's places all over where I can change divides into shifts - i'll try it later on and see what happens. I also changed DrawSync(0) in my main loop to DrawSync(1) to terminate all non-blocking graphics functions before changing display buffers, instead of waiting for them to end - I got a significant speed increase when no map blocks are being displayed, but the same amount of hysnc time when everything is zoomed in. I guess it must be down to my code (the memory traffic can't be helping much when scanning through the map array either), but I still find it hard to believe the yaroze can only scale/rotate around 440 sprites (actually, probably more if you remove the GsSortFixBG16 map in the background) before you start to feel panic about the amount of raster time you are left with! At the moment, the very worst slowdown is around 230 hysncs, but it doesn't affect the screen updates noticably until almost 300. There's still a couple of tricks I can resort to though, so all is not lost! Thanks again! Andy > instead of: > > if(offsetX++ < 0) > { > offsetX += BGSizeX; > } > > offsetX %= BGSizeX; > > try: > > offsetX ++; > if (offsetX == BGSizeX) offsetX= 0; > > which I think would be much faster (obviously you still need the % > in the earlier code when offsetX can be any value). > The exception to this would be if BGSizeX was a multiple of 2, > in which case val % BGSize is equivalent to val & (BGSizeX-1) > (*but* the compiler won't perform this optimisation because it > doesn't know the value of BGSizeX at compile time). You'll have > to try different values and code to see which gives you the best > performance. > > Martin. > > >