EasyManua.ls Logo

Commodore Amiga A2000 - Descending Mode

Commodore Amiga A2000
380 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
NOTE
Even though the A channel is disabled, we use it in our logic function and preload the data
register. Disabling a channel simply turns off the memory fetches for that channel; all
other operations are still performed, only from a constant value stored in the channel's
data register
An alternative but more subtle way of accomplishing the same thing is to use an A shift of
five, a first word mask of all ones, and a last word mask with the rightmost nine bits set
to zero. All other registers remain the same.
NOTE
Be sure to load the blitter immediate data registers only after setting the shift count in
BLTCON0/BLTCON1, as loading the data registers first will lead to unpredicTable results.
For instance, if the last person left BSHIFT to be "4", and I load BDATA with "1" and then
change BSH1 to "2", the resulting BDATA that is used is "1<<4", not "1<<2". The act of
loading one of the data registers "draws" the data through the machine and shifts it.
DESCENDING MODE
Our standard memory copy blit works fine if the source does not overlap the destination.
If we want to move an image one row down (towards increasing addresses), however, we
run into a problem - we overwrite the second row before we get a chance to copy it! The
blitter has a special mode of operation - descending mode - that solves this problem
nicely.
Descending mode is turned on by setting bit one of BLTCON1 (defined as BLITREVERSE).
If you use descending mode the address pointers will be decremented by two (bytes)
instead of incremented by two for each word fetched. In addition, the modulo values will
be subtracted rather than added. Shifts are then towards the left, rather than the right,
the first word mask masks the last word in a row (which is still the first word fetched, and
the last word mask masks the first word in a row.
Thus, for a standard memory copy, the only difference in blitter setup (assuming no
shifting or masking) is to initialize the address pointer registers to point to the last word in
a block, rather than the first word. The modulo values, blit size, and all other parameters
should be set the same.
NOTE
This differs from predecrement versus postincrement in the 68000, where an address
register would be initialized to point to the word after the last, rather than the last word.
Descending mode is also necessary for area filling, which will be covered in a later section.
- 176 Blitter Hardware -

Table of Contents

Other manuals for Commodore Amiga A2000

Related product manuals