Amos Professional Manual  Contents  Index

AMAL


CHANNEL
instruction: manipulate a screen
Channel channel number To Screen Display screen number
Channel channel number To Screen Offset screen number
Channel channel number To Screen Size screen number
Channel channel number To Rainbow rainbow number

Moving a screen
Normally, the SCREEN DISPLAY command is used to position the current screen on a television display. However, you may need to achieve the same effect using interrupts, and the CHANNEL instruction may be used for this purpose. Simply specify which channel number is to be set to which screen number, and the X and Y variables in AMAL will hold the position of the screen in hardware coordinates. Note that register A is not used by this technique, and screens may not be animated using the ANIM command, although all other AMAL instructions can be performed as normal.

In fact the screen number can be defined anywhere in your program, and this system will work perfectly provided that the screen is opened before the animation is started. Here is a simple example:

E> Flash Off : Load Iff "AMOSPro Examples:Iff/Logo.Iff"
   Channel 0 To Screen Display 0
   Amal 0,"Loop: Move 0,200,100; Move 0,-200,100; Jump Loop"
   Amal On: Direct

Hardware scrolling
Using hardware scrolling to manipulate screens can be achieved by the SCREEN OFFSET instruction, but it is often much easier to animate screens using the smooth techniques of AMAL. Specify which channel number is to assigned to which screen number, using the CHANNEL command in conjunction with the SCREEN OFFSET command. AMAL's X and Y registers will now refer to the section of the screen which is to be displayed on your television display. By changing these registers, the visible screen area can be scrolled around the display. Try moving the mouse in Direct Mode, to affect this example:

E> Screen Open 0,320,500,32,Lowres : Rem Open tall screen
   Screen Display 045,320,250
   Flash Off : Cls 0
   Load Iff "AMOSPro_Examples:Iff/Logo.Iff"
   Screen Copy 0,0,0,320,250 To 0,0,251
   Screen 0: Get Palette (0)
   Channel 0 To Screen Offset 0
   Amal 0,"Loop: Let X=XM-128 ; Let Y=YM-45 ; Pause; Jump Loop"
   Amal On : Wait Key

Changing the screen size

Similarly to moving and scrolling a screen with the CHANNEL command, the size of a screen

Back    Next
07.06.14