Re: Vector rotation

From: Paul Kahler <phkahler_at_Oakland.edu>
Date: Tue May 15 2001 - 11:24:08 EDT

> > x' = c*x + s*y
> > y' = -s*x + c*y
> >
> > Funny, I've seen Cinematronics code to do this very operation using
> > 8 multiply instructions for each product - it's about a page of code.
>
> If you mean 8 MUL instructions, then surely that isn't a surprise?
>
> Each MUL instruction on the Cine is just one shift+add step of Booth's
> algorithm. You need 8 of them in a row to execute an 8-bit multiply.
> But you must know that - you wrote one of the emulators. is there
> something else about this code in the Cine that's funny? I'd be quite
> interested in identifying this entire sequence as a block that can
> be removed and replaced with a high-level emulation (in my automatic
> translation of tailgunner to C), so if you have that page of code, maybe
> you could email it to me :-)

I think I first saw it in Star Castle or RipOff. I don't have the
disassembly any more, and you'd need to learn the Paul/Kurt mnemonics
to read it anyway :-) I suspect that block got reused a lot though.

Other funny things?

Try to emulate toggling the "bright" bit while a line is drawing :-)

Treat the normalize instruction as a NOP. We do. It's used to extend
vectors (dx,dy) so the beam tries to overshoot the endpoint. Then the
hardware turns the beam off part way there, otherwise lines would
be brighter at the end due to nonlinear beam speed. Using a NOP will
cause the vectors to be unmodified the way you want them :-)

I doubt this instruction is used for anything else, however
Speed Freak doesn't quite run on our emulator.

Technically ANY branch instruction can be used to select the
secondary accumulator, but it's not used that way much if at all.

Star Castle never uses the carry flag, so it's a nice game to
start with. Flags were a big deal for me to get correct (fortunately
I started with S.C.) If I had to do it again, I'd store the compared
values rather than the flags. Then evaluate the flags only on a
conditional branch - and then only the one you care about. Then again,
we run OK on a P90, so speed isn't a big deal. The problem is that there
are SO many instructions that affect the flags - I think anything that
modifies/loads an accumulator.

Hope that helps,

--
<pre>
 ___   __   _   _  _
|   \ /  \ | | | || |       phkahler@oakland.edu     Engineer/Programmer
|  _/| || || |_| || |__     " What makes someone care so much?
|_|  |_||_| \___/ |____)      for things another man can just ignore. " -S.H.
---------------------------------------------------------------------------
** To UNSUBSCRIBE from vectorlist, send a message with "UNSUBSCRIBE" in the
** message body to vectorlist-request@synthcom.com. Please direct other
** questions, comments, or problems to neil@synthcom.com.
Received on Tue May 15 11:36:31 2001

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2003 - 00:32:18 EDT