Path: chuka.playstation.co.uk!news From: Andrew Partington Newsgroups: scee.yaroze.freetalk.english Subject: Re: negative scrolling on homebrew map routine - need help!! Date: Wed, 21 Mar 2001 17:07:06 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 87 Message-ID: <3AB8DFBA.7BDE2A4E@harbinger.com> References: <3AAF7BB2.B427AED3@harbinger.com> <98o38v$ij81@www.netyaroze-europe.com> <98p3qp$rms2@www.netyaroze-europe.com> <98t840$6f5@www.netyaroze-europe.com> <99057g$3ok7@www.netyaroze-europe.com> <3AB6404F.65C9AF1C@harbinger.com> <9961fn$7jl4@www.netyaroze-europe.com> <99624q$7jl5@www.netyaroze-europe.com> <9963bb$7jl6@www.netyaroze-europe.com> <997j6l$7jl8@www.netyaroze-europe.com> <3AB774C7.6B4D8F95@harbinger.com> <998bjc$7jl11@www.netyaroze-europe.com> <3AB8A751.A5D36CCF@harbinger.com> NNTP-Posting-Host: manuk81.harbinger.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en Hang on - I think I know why i'm having problems setting the stack to point at the DCache: I was browsing the member homepages and I came across Andreas Schrattenecker's page - he did something similar, but he was using a couple of global variables to store the stack pointer in, instead of trying to dump it straight on the stack like the thick git that I am :-P Andreas reckons he's getting a 400% speed increase under CW, negligable speed increase under GCC - is GCC really that much better when it comes to producing optimal code? Cheers Andy Andrew Partington wrote: > Thanks Peter, that worked 100%! But now I can't see how many HSyncs/frame I am > getting - is there any way I can get my VSync(0) value back using callbacks > without causing another wait for vertical retrace? (calling VSync with values > greater than 0 doesn't seem to return anything useful) > > I also tried setting the stack to point at the DCache, as in the the NY FAQ. > The given asm wouldn't work for CW though, so I tried to come up with something > I thought was equivalent... > > volatile asm void SetStackToDCache() > { > sw $29,0(sp) // Put R3000 register 29 (stack pointer) > onto stack > lw $29,0x1f8003f0 // Point at the upper bound of DCache (since > the stack grows downwards) > } > > volatile asm void SetStackToR29() > { > lw $29,0(sp) // Restore stack pointer > } > > Trying this out, (not surprisingly perhaps, since the first item of the stack > might have had some useful value in it) I got the black screen of death! I know > the DCache is only 1K but I don't think I was putting enough params on the stack > to overflow it (unless setting the project to build with maximum optimisation > has reorganised the code somewhat, or I may need a delay slot to be filled with > nop after the load). > > Can anyone see what I am doing wrong? Also, do I set the stack to point at the > DCache as the very first thing in the initialiation code, or only before a > time-critical procedure call (resetting it afterwards)? Or would a better > approach be to just dump structures into the DCache as needed without touching > the stack pointer? > > Cheers everyone! [crikey, this thread's getting hefty innit! Not that i'm > complaining :)] > > Andy > > Peter Armstrong wrote: > > > "Andrew Partington" wrote > > > > > > Last night I attempted using VSyncCallback() for the first time to attempt > > to > > > get more raster time (as explained in the Net Yaroze FAQ), but I couldn't > > get it > > > working [so I went away and had a look at some other optimisation measures > > > instead, none of which seemed to have much effect :( ] > > > > > > I had something like: > > > > > > (in my globals section of my code) > > > volatile int waitVSync = 0; > > > > There are problems accessing global variables from within the callback > > function. Try declaring your variable as > > > > __declspec(bss) volatile int waitVSync = 0; > > > > This should work. There's also another method, which involves restoring the > > gp register value, check out the CW doc Targeting Net Yaroze, page 66/67 for > > more info. > > > > Peter