[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shape table code question
On May 15, 10:33 pm, Jonno Downes <jonno...@gmail.com> 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.
>
> 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?
>
> Cheers
>
> Jonno
move up - 000
move right - 001
move down - 010
move left - 011
plot then move up - 100
plot then move right - 101
plot then move down - 110
plot then move left - 111
Everything is pretty much as you stated. The only exception is the
high 2 bits can not be used to plot, or to move up. If there are two
move move-up vectors in a row, then that is considered to be the end
of the shape table. If the high 2 bits are non-zero, then they can be
used to move right, down and left. If the two high bits are zero,
then they are ignored. I believe the general rule is to avoid upward
movements without plotting.
Two upward movements are usually done like this;
move up
move right
move up
move left
The move right or move left vectors can be done in the 2 high bits
thus possibly saving an extra byte.
One of the Nibble magazines has a pretty good shape illustrator to
design shapes, although it is programmed to ignore the high 2 bits.
Rob