home *** CD-ROM | disk | FTP | other *** search
- <head>
- <title="...forever...">
- <font=monaco10.fnt>
- <font=newy36.fnt>
- <font=time24.fnt>
- <image=back.raw w=256 h=256 t=-1>
- <buf=1863>
- <bgcolor=-1>
- <background=0>
- <link_color=253>
- <module=console.mod>
- <pal=back.pal>
- colors:
- 251 - black
- </head>
- <body>
- <frame x=0 y=0 w=640 h=1863 b=-1 c=-1>
-
-
- | | | | |
- +---------------+
- _| BLITTER |_
- _| Step by Step |_
- +---------------+
- | | | | |
-
- By Saulot/ Nokturnal/ Chosneck TEAM ' 2003
-
-
- 1) Firstly we need to calculate the starting buffer of our source raster. In
- this helps us the following equation:
-
- [screen address] + y * (line lenght) + 2 * (x/16) * (number of planes)
-
- We write the result into $ff8a24 address.
-
- 2) We calculated the source raster we need to calculate the destination using
- the same equation from 1). The result has to be written into $ff8a32.
-
- 3) We need to estimate the interleave between the words in a one bitplane. (1
- bitplane=0, 2 bitplanes=1, 3 bitplanes=2, 4 bitplanes=3). We write the needed
- value into $ff82a20 for source raster and into $ff8a2e for destination raster.
- Usually the 2 value is written, other values let you, for example copying of a
- single bitplane.
-
- 4) We estimate the offset between the particular screen lines:
- offset= lenght of the line - (width of copied block-2)
- "Length of the line" and "width of copied block" are rounded off to 16 pixels,
- e.g 9 pixels are 4 words in 320*200. The values are written to $ff8a22(source)
- and $ff8a30 (destination). We can set the different values for source and
- destination, this gives us the possibility to copy of screens in different
- resolutions, copying of single bitplanes etc.
-
- 5) Now is time to estimate of the copied block size:
- To X_COUNT register we need to write the width of destination in words (e.g for
- 18 pixels we write 8) If the block has to be additionally shifted we have to
- enlarge it's size for 16 pixels (4 words must be added).
-
- 6) Setting of values for masking and shifting:
- The state of 4 least significant bits in SKEW register ($ff8a3d) tells us how
- many bits to the right source raster has to be shifted. The masking of unwanted
- bits is needed, e.g if the sprite in the buffer has to be shifted 4 bits, then
- the first 4 and the last 12 bits has to be unchanged. And now we step into the
- realm of endmask registers.
-
- There are three mask registers:
- endmask1 (mask of a 1st word),
- endmask2 (all the words inbetween endmask1 and endmask3),
- endmask3 (mask at the ending word)
-
- In our example it will look like this:
- (%0000 1111 1111 1111)[endmask1],
- (%1111 1111 1111 1111)[endmask2],
- (%1111 0000 0000 0000)[endmask3].
-
- Set of masks needed in transfer of blocks not being the multiplication of 16:
-
- E.g we have to transfer block of 25 pixel width, to X_COUNT we write "8" value.
- After that blitter copies 8 words(or 32 pixels). Not needed pixels from 25 to
- 31 we mask with $8000 (%1000 0000 0000 0000) applied to endmask3. The
- same solution applies to copying of whole blocks on coordinates not being the
- multiplication of 16. In this case Blitter gets the not needed bits, which has
- to be masked from endmask1 register e.g for x=100 in ST-LOW, the offset
- which has to be added to screen adress is 48, and endmask1=$0fff.
-
- 7) Now is time to set how the content of halftoneRAM will be added to
- destination data. 16 logic operations are available (source<-->destination).
- The kind of logic operation is chosen by writing the appropriate value(0-15)
- into blitter's OP register ($ff8a3b).
-
- 8) Possibility of modification of copied data gives us the halftoneRAM (16
- registers in total). With HOP register we can choose one of four logic
- operations, which has to be performed between data block and cyclically
- changing halftoneRAM registers. If we additionally clear the SMUDGE bit
- in $ff8a3c register, then 4 least significant bits let you choose the specific
- halftoneRAM register, which has to be used as a first one. If SMUDGE bit is
- set, about used halftoneRAM register, 4 least significant bits of source data
- block have the deciding role.
-
- 9) Blitter requires the size of destination block not the source. There can be
- the situation when source data can be different in lenght in comparison to the
- data after the shifting operation has been done. To avoid unwanted gaps in the
- memory (words are treated with masks), we have to set NFSR and FXSR bits:
-
-
- NFSR = 1 - Blitter is not reading the last word of source data (used when data
- after the shifting are increased by 1 word).
-
- FXSR = 1 - Blitter reads additionally 1 word of source data (set when the
- source data after the shifting are 1 word longer).
-
-
- Before we start the use of Blitter we have to choose the mode of it's
- operation. There are two modes:
-
-
- HOG MODE - normal mode - blitter takes control over the bus until the data
- transfer is done.
-
- INTERLACED MODE - Blitter and M68k are sharing the bus (they are switching
- between themselves for a constant period of 64 CPU cycles).
-
-
- In case HOG mode no detection of ending transmision is needed, because the bus
- is busy until the transfer is done. INTERLACED mode requires the test of
- 7th bit of control register($ff8a3c) for detecting the end of data
- transmission. It can be done also via MFP interrupt register, Blitter generates
- the interrupt on the 3rd level after the end of data transfer.
-
-
- -- - --- -- -------------------------------------------------------------------
- CHOSNECK 4th appearance contact us:
- done by the dream survivors greymsb@poczta.fm
- ----------------------------------------------------------------- -- - --- ----
- </frame>
- </body>
-
-