Path: chuka.playstation.co.uk!news From: dave@lunar1.demon.co.uk (David Wagner) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Rotation property of sprites Date: Tue, 07 Apr 1998 17:56:59 GMT Organization: Not very. Pretty unorganised in fact. Lines: 24 Message-ID: <352d67a9.2364597@www.netyaroze-europe.com> References: <352a3987.6501481@www.netyaroze-europe.com> <3529F85F.7EFC4AC3@micronetics.com> NNTP-Posting-Host: lunar1.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Newsreader: Forte Agent 1.5/32.451 Thanks for your advice. One question though, I thought 4096 = 1 degree for the rotation property? On Tue, 07 Apr 1998 10:56:47 +0100, Jim wrote: >Use 4096 as 360deg. >An easy way to flip back to zero is to used a bitwise &, take rx as the >variable. > >rx += 32; // rotate it a bit >rx &= 4095; // mask out anything > 4095 > >If you want to measure everything in degreese. > >rx += 32; >rx %= 360; // wrap back to 0 > >Its possible that the psx doesn't trap an overflow exception and would >get stuck in the exception handler. Although I would doubt this as >overflowing regs would be quite common. > [munched by the terror of the Cave of Caerbannog]