[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shape table code question
Jonno Downes wrote:
Howdy
Can anyone point me at an explanation of how the vector bytes in a
shape table are interpreted?
I've seen various explanations of how to create shape tables, and they
all talk about creating vectors, then coding that vector into 3 bit
sections where
first bit of 3 : 0=dont plot, 1=plot
remaining 2 bits of 3: 00=move up, 01=move right, 02=move down,
11=move left
then you take 2 of these 3 bit codes, prepend with "00" and you have
an 8 bit byte to put in your shape table.
Actually, you try to put *three* vectors in each byte, with
the proviso that the third must be a "move" and not a "plot"
Which all makes sense, except I am currently looking at the Beage Bros
"Apple Mechanic" manual (http://beagle.applearchives.com/the_software/
vintage_beagle_bros_softwar/apple_mechanic.html ) and there is a table
on page 46 "Apple Shape Table Vectors" that shows the high 2 bits can
be nonzero, and all 8 bits in the byte are significant.
Can anyone explain exactly how the vectors are decoded?
The two lower-order 3-bit groups are used as-is, and the third,
two-bit vector is used with a high-order 0 prepended. It is often
possible to code a shape so that all three vectors in a byte can
be used, though the "top" one is restricted to a non-plotting move.
Shape coding is constrained even more if it is desired that the
shape be able to be used with SCALE > 1 and still look right.
But as long as SCALE will always be 1, and each vector either does
or does not plot a point, there is considerable freedom in choosing
the order of the moves and plots, to minimize the total size of the
shape table entry.
One should also arrange to plot each point exactly once, so that
and XDRAW will properly erase the shape.
It is also worth noting that the total number of vectors is a prime
determinant of the time required to DRAW a shape, so lots of redundant
moves can slow things down.
-michael
NadaNet and AppleCrate II: parallel computing for Apple II computers!
Home page: http://home.comcast.net/~mjmahon
"The wastebasket is our most important design
tool--and it's seriously underused."