Amos Professional Manual  Contents  Index

AMAL


can be changed when CHANNEL is used in conjunction with SCREEN SIZE. When the channel number is assigned TO a screen number in this way, registers A and Y will control the width and height of the screen. Here is an example:

E> Load Iff "AMOSPro Examples:Iff/Logo.Iff",0
   Channel 0 To Screen Size 0
   Screen Display 0,320,1 : Rem Set screen size to 1
   A$="Loop: For R0=0 To 255; Let Y=R0; Next R0;"
   A$=A$+"For R0=0 To 254; Let Y=255-R0; Next R0 ; J Loop"
   Amal 0,A$ : Amal On: Direct

Creating rainbow effects
The final use of CHANNEL is with the RAINBOW command. As usual, a channel number between 0 and 63 is assigned to a rainbow number. Please remember that rainbow numbers range from 0 to 3. The X register will now hold the first colour of the rainbow palette which is to be displayed, and by changing the value in this register the rainbow will appear to cycle. The Y register will contain the line on screen where the rainbow effect begins. By changing this value, the rainbow effect can be moved up and down. All positions are measured in hardware coordinates. Finally, register A stores the height of the rainbow on screen. Remind yourself of the scrolling rainbow effect in this instant example:

LD> Load "AMOSPro_Tutorial:Tutorials/AMAL/AMAL_4.AMOS"

The Autotest system
Normally, all AMAL programs are performed in sequence, from start to finish. There are certain routines that will take a few seconds to complete, such as a For ... Next loop or a Move. In most cases this does not cause any problem, but sometimes delays can be caused. The Autotest feature is provided to solve such problems, and it is used to change the sequence of instructions.

The following example demonstrates just such a problem, which could benefit from an Autotest. In this example, the Sprite is supposed to follow the movements of the mouse. However, because the new XM and YM movements are entered after the Sprite movement has completely finished, the routine is unacceptably slow. Try moving the mouse in a circle, to exaggerate the problem:

E> Load "AMOSPro_Tutorial:Objects/Sprites.abk" : Get Sprite Palette
   Sprite 8,130,50,1
   Amal 8,"Loop: Let R0=XM-X ; Let R1=YM-Y ; Move R0,R1,50 ; Jump Loop"
   Amal On: Direct

After an explanation of the Autotest commands, and an explanation of how to use them, you will be able to rewrite that example and solve the problem.

AUTOTEST
AMAL Autotest system
AUtotest (list of test commands)

The feature is activated by a call to AUtotest, followed by a pair of brackets containing the series of the tests you want to use.

Back    Next
07.06.15