Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scee.yaroze.programming.libraries Subject: Re: VSyncCallback Date: Tue, 08 Jul 1997 17:29:52 GMT Organization: SN Systems Lines: 28 Message-ID: <5ptt8s$8c10@chuka.playstation.co.uk> References: <33BB7448.19E8E81D@cryogen.com> <33BB9DF0.FE2EB39B@micronetics.com> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.0.82 Jim wrote: >Are you using compiler optimisations?? I believe there is a glitch in >the compiler when relating to the $gp register inside the callback. >The workaround is to put you callback function and shared variables in a >separate .c file. Compile that with NO optimizations. And link it with >your other optimized objects. You will probably have to write a header >file to declare the variables and prototypes as externs. The information I have is that when coding an event handler you have to compile with -G0, as the GP register has been loaded with the kernel's small-data section address at this point. (You could reload GP yourself at the start of the event handler code but this might be difficult unless you know the structure of the kernel data.) However, it also says here that callback routines don't suffer from this problem because the kernel knows to reload GP for you before executing the callback. Perhaps it's different on the Net Yaroze, though. I have no idea of the source of this information, incidentally; I'm just transcribing it from our notes on the subject. ("I'm a doctor, Jim, not a PlayStation programmer!") It's either trial-and-error or a rephrasing of a Sony doc. Gil Jaysmith SN Systems Software Ltd, makers of Psy-Q... http://www.snsys.com Disclaimer: What I say when I post here represents me, not my employers.