- SEPTiC DEMO'S COLLEGE -- 

                                  Lesson 5 
                                  ????????? 
                         Written by Vicious / Septic 

                                  05 Jun 93 



                                  Introduction 
                                  ????????? 
After two lessons about bitplansgrafik we will now proceed to the sprites, and 
make (in the past) a lot (but unfortunately, even now) common type of 
star scroll! Enjoy! 


                                    Theory 
                                    ????? 
Although the sprites look like ordinary bitplansgrafik is the really quite 
regardless of the graphics behind-front of them. To make some scroll of stars 
behind a vektorkub therefore require no more effort than to make them 
at a blank screen. There are only eight channels of Amigan Sprite, which only 
allows that eight sprites appear at the same time, AT THE SAME RASTERRAD! Will it 
driving spirit of helter-skelter on each other so it is thus only eight 
pieces, but ensures that they are following each other down on the screen 
(who starred in a horizontal scroll) so you can use a re - 
technology, which allows Sprite channel shows a new Sprite after the 
become clear with the last ... This means that in a star can scroll 
Monday draw out a star and then wait for a new series with the same spirit channel 
and drawing out yet another new star. In this way you can show maybe 200 
stars with just A spirit channel, and whether you use every channel spirits 
to a warehouse stars, is 8 layers of 200 stars in each, which 
gives 1600 points ... Quite right. 
   One alcohol may only be 16 pixels wide (not AGA), but it can be 
how high any time! It can only have 4 colors in typical fashion, but we use 
attached mode (which offers 16 colors) so halved spirit channel-number to 4. 
   A Sprite is structured as follows: 

    WORD 1 - Bit 15-8 containing the 8 lowest VSTART-bits 
             Bit 7-0 containing the 8 bits of high HSTART 
    WORD 2 - Bit 15-8 containing the 8-bits low VSTOP 
             Bit 7 (used in the attached mode) 
             Bit 6-3 Not used 
             Bit 2 VSTART highest bitten 
             Bit 1 VSTOP highest bitten 
             Bit 0 HSTART low bit 

Then follow the Sprite data for graphics and then either two words with 
zero, or new liquor control Word for the next spirits. 
   VSTART stands for the vertical take-off position and for VSTOP 
end position. This indicates therefore the height of the booze. HSTART is the 
horizontal start position. All these figures mentioned in 
hardware coordinates, which starts a bit before the real screen. 

   A Sprite can look like this: 

    DC.W $ 6D60, $ 7200; VSTART, HSTART, VSTOP 
    DC.W $ 0990, $ 07E0; Data for graphics in two bitplan. 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 23C4, $ 1FF8 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 0990, $ 07E0 
    DC.W $ 0000, $ 0000; End of the Spirit data 

This booze will appear on horis.pos $ 60 and vertical pos $ 6B to 
$ 72 ... Sprite graphics created easiest in a RAW Thursday IFF converter. 
   If you want to re spirituous use the channel so it's just that chin on the new 
Spirit data where losers are: 

    DC.W $ 6D60, $ 7200; VSTART, HSTART, VSTOP 
    DC.W $ 0990, $ 07E0; Data for graphics in two bitplan. 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 23C4, $ 1FF8 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 0990, $ 07E0 
    DC.W $ 8D90, $ 9200; Our new Sprite starts here! 
    DC.W $ 0990, $ 07E0; Data for graphics in two bitplan. 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 23C4, $ 1FF8 
    DC.W $ 13C8, $ 0FF0 
    DC.W $ 0990, $ 07E0 
    DC.W $ 0000, $ 0000; End of the Spirit data 

Here's our first Sprite to appear in the same place as before, but the same 
Spirit channel will now also show a similar position at $ 90, $ 8D. 
Fantastic! 

                                  Register 
                                  ???????? 
First and foremost, we must turn to spirit DMA in DMACON ($ dff096) in the ordinary 
order. Then we only need to set some pointers each vertical blanking 
to DMAn going to show our beautiful spirit. As they should be set each 
VBL, we will of course (surprise, surprise!) Update them 
with ..... COPPER! 
   SPR0PT ($ DFF120) units on the first spirits pointer and then Next 7 
Long words to the other pekarna that we have set. 
   How do I make this smooth, you'll see in the sample. 
   Spirits The colors are set in color registers 16 to 32, and there are two 
spritepar 4 colors each. It means that Sprite 0 and 1 share 
colors 16-19, Sprite 2 and 3 on the colors 20-23, Sprite 4 and 5 at 
colors 24-27 and spirits 6 and 7 on the colors 28-31. 
   Using attached mode (16 colors) as part of the four spirits makers in 
colors, 16-31. 


                               Program example 
                               ??????????????? 
Well, not much to comment really ... What a stellar scroll where we 
seen 10958345 times before! Usually it be in just three stocks, but 
I have squeezed into six-stocked as any scrolls in 
different speeds from 1 to 6 pixels each vertical blanking. 
   Scroll Nobody is done by modifying each sprites control WORD, where the 
horizontal position stands. It will voluntarily adopt "wrapper around" when 
exchanges reached 255 and the outer screen is reached. 


                                  Challenge 
                                  ???????? 
This time, I thought to do a simple challenge to all 
(hopefully) can participate ... 
   What I want you to do is to write about this lesson program 
example, to clear two directions at stjarnscrollen. Right and left! 
The stars are set to scroll to the right, first, and when you press 
joystick button to scroll to the left instead, and so you should be able to 
hold on and change direction until you get the brain, or press 
mouse button. 
   Read by the joystick in the same way as the left mouse button, but with bit # 7 
instead of # 6: 

    BTST # 7, $ BFE001; Read the joystick button ... 

   This may well not be too difficult? I will present a solution 
in the next lesson, but until then I want to have a lot of fun attempt by you 
side! 


                                   Questions 
                                   ?????? 
If there is something you do not understand or who you are, I reply more 
than happy to your questions. Ideally (if you have access to the modem) through 
that you are calling to 22 Acacia Avenue: 

         Nod.1: 036 - 378,007 - 14400BPS DS - 315MB / A3000 
         Nod.2: 036 - 371,021 - 14400BPS HST - Cnet / 25 MHz 

You can also write to me, but then you must enclose the reply postage so that I 
will not be penniless! The address is: 

                               Vicious Septic 
                                Klosterg. 19 
                              S-56792 Vaggeryd 


                                  Finally 
                                  ????????? 
Each new lesson in this course is published every other weekend at 22 Acacia 
Avenue of the special "Demo Course" area that I also suboperator 
too. Where can you write me letters, and debate on the demo programming. 
Programs that may be necessary to have in the future will also be 
available there. 
   The next lesson will be on the base on June 19, so make sure you call and when 
download it! 
   Now it was the end of this time! Cynez!