- SEPTiC DEMO'S COLLEGE -- 

                                  Classes for 2 
                                  ????????? 
                         Written by Vicious / Septic 

                                  23 Apr 93 



                                  Introduction 
                                  ????????? 
Well, it was time for the second lesson in the demo school. I hope that 
the first part did not cause you any major problems. If it did so was 
not afraid to ask me! I respond to everything, and I can even explain 
certain "code-technical" matters, you are assembler beginners, you just 
asks ... 
   Well, last time I raised the basics of copper programming. I 
would continue with a small program that uses copper opportunities 
to change colors. It is not very advanced, but should probably be 
interesting for the beginner, I hope! 


                                  Register 
                                  ???????? 
The only new record I need to address today is VPOSR ($ dff004). It is, 
just as many other records, a READ ONLY register. It really is 
horizontal and vertical position in the register VHPOSR ($ dff006), where the 
eight lowest bits are horis position and the eight highest bits are 
vert position. This is of course not on a PAL amiga, because we 
must be able to wait for positions over $ FF (which do not fit in a byte); 
but when you find the highest piece of VPOSR ($ dff004). 
   When one program demos, it is important to wait for breaks beam 
position in order to avoid even the routines flimmrar or perhaps even 
disappear sometimes. If you do not wait on the "Sync", as it is called, can 
routines also move at different speeds on different computers, and music practice yesterday 
DEAD too fast. (You can try to eliminate the hope for a routine 
SYNC in the main loop in my program to see the difference, and why it should 
sync in their program ...) 
   Well, some people tend to just wait for the vertical position becomes zero 
by the simple tests: 

WT: TST.B $ DFF006 
       BNE.S WT 

   This can be good sometimes, but usually it is stupid. Around this 
position, thus vertical position zero, is very updates, 
copper restaurants rtas and Interrupt executed, which can make our routine 
delayed (if you have bad luck), and it is also inflexible if you want to run 
a simple little bob at the top of the screen, because then it will not appear. 
   So, you should be able to choose the vertical position you want to wait, 
and it is the method I use: 

sync: move.l $ dff004, d0; Here I get is both horizontal 
                                 ; And vertical position, plus the most 
                                 ; Significant piece of the vertical 
                                 ; Position and then 
         and.l # $ 1ff00, d0; worms I remove, with the command AND, all 
                                 ; Unnecessary bits, then the horizontal, 
                                 ; Because I just check the vertical. 
         lsr.l # 8, d0; Then I make a small shift to 
                                 ; Vertical position is at the bottom of 
                                 ; Wordet ... 
         cmp.w # $ f0, d0; Now I compare it only with the vertical 
                                 ; Position I want to wait and 
         bne.s sync; jump back if it was not right ... 

The rest of the program will not mean anything new ... The foundation is our last 
program, thus the old start DRUNKEN. If you have forgotten copper instructions 
you can look in lesson 1. 
   Notably perhaps, is how to put a copper list, which puts the 
in a perpetual loop. It is made by a two-word like this: 

    DC.W $ FFFF, $ FFFE 

What the instructions actually do is to wait unconditionally in a position 
that will never happen, and therefore copper stays there until it receives 
a signal that the display is updated again, and then start it again from the beginning 
of the list. 
   Another interesting thing is how to wait in lines over 255. The 
WAIT vertical position is just one byte, and holds not higher 
speech than 255. Well, then there is a small tricks ... We are waiting for the very last 
position that can happen, and then goes over copper automatically in a 
"PAL-mode", which you might call it, and $ 100 added to all WAIT-satsers 
vertical position. This means that the position is the position 02 $ 102 
instead. 
   We are waiting for "PAL" with the following WAIT-rate: 

    DC.W $ FFDF, $ FFFE 

I also show that in the sample, so look happy there, too. 

It was all under the heading index for this time, but there will be new 
exciting things next time! 


                               Program example 
                               ??????????????? 
This time, I have only gone up a little more on copper programming, and 
the program shows an old power - rocking copper bars ... 
   Making these beams is relatively easy. First and foremost, we must 
reserve space for them in their copper list, and because it is very 
sad to write 168 lines wait so we just reserve spot with zeros, 
and copper generates code in our program. 
   Code-generation do I do in the routine ClrBars. The choir I each vertical 
blanking, since the same time it generates copper code, clearing the 
old beams. The technique I use to generate the code is very 
easy. I suggest instead that we should move in the code and then put two 
data records to the instructions we need. The first instruction is a 
WAIT, and the other is a MOVE. MOVE instructions will certainly always be 
$ 01800000, because we just want to bring the background color. WAIT instruction 
however, we must improve on all the time, so that the waiting on line after 
previous. 
   The routine Swing Bars ago, I print the six breaks beams one after 
one, with the top of the smallest, always far away. 
   I read only by a sinus value from the table, and multiplying it 
to me in the right place in the copper list, and then for me the color values 
there. As I said, not so difficult, but perhaps a little tricky for the beginner. Come 
happy with the issues in that case! 
   If you want, like changing a little bit of copper graphics at the end of the source. 
As you can see the graphics are built with the usual color changes, as you can, for example, change 
first beam, 

; Bar 1 (narrow) 
Dc.w $ 700 
Dc.w $ 800 
Dc.w $ 500 
Dc.w $ 000 

to a yellow beam: 

; Bar 1 (narrow) 
Dc.w $ 770 
Dc.w $ 880 
Dc.w $ 550 
Dc.w $ 000 

   Experiments on only! So you will hopefully understand how the 
works! 


                                   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 May 8, so make sure you call and when 
download it! 
   Now it was the end of this time! Cynez!