The AMAL Editor accessory allows you to pack your AMAL programs into a single memory bank, so that routines can be entered directly from the keyboard and edited on screen. All of the AMAL Editor features are called up via drop-down menus, which include a built-in monitoring system for rapid debugging, and a movement-pattern recorder.
The AMAL Editor can be used as an accessory, in which case memory banks defined by your main program will be grabbed automatically, or it can be used as a normal AMOS Professional program.
Please select the AMAL Editor now, from the AMOSPro_Accessories disc.
After loading, the AMAL Editor displays its main String Editor Screen, which is always allocated to screen number seven, and which is where AMAL program strings are created for storing in the AMAL bank. Please remember not to use this screen number for your own programs, when using the Editor. The screen is divided into three horizontal zones, as follows:
The Information Line
At the top of the screen, a black Information Line lists the current mode and also displays the
AMAL channel number currently being edited. All of the drop-down menus are triggered by
clicking in this Information Line, using the right mouse button. By using the left mouse button
and then dragging the Information Line up and down, the entire String Editor Screen can be
moved vertically, to reveal the current program display.
The Selection Window
Below the Information Line, there is a grey Selection Window. This is where any of the AMAL
programs that are stored in memory can be selected for editing. In the centre of this window
there are two rows of characters, one above the other. These items are read vertically, so the
item on the left-hand side reads EE, which refers to the Environment Editor, which is explained
at the end of this Chapter. The Next item refers to channel 00, then channel 01, all the way along
to channel 15.
When one of these programs is selected with the left mouse button, it is highlighted in inverse video, and loaded to the Editor Window. There is a [Synchro On/Off] feature, which is explained later, and if the [Synchro Off] option is selected, the number of channels is extended from 16 to 62. In this case, only the first 16 of these routines can be performed using the standard AMAL interrupt system.
The Editor Window
This is the large orange panel that occupies most of the screen, and it operates in a similar way
to a normal AMOS Professional Edit window. AMAL programs can be entered at the current
cursor position directly from the keyboard, and the mouse can be used to move the position of
the editing cursor directly.
Here is a list of the editing controls:
Return Insert a line Ctrl + Y Delete a line [Tab] Jump to next Tab position [Cursor arrows] Move cursor one place up, down, left or right Shift + Cursor arrows Move cursor to start / end of line, or top / bottom of screen
Lower drag bar
At the bottom of the String Editor Screen, there is a black bar, which can be dragged vertically
using the left mouse button, to reveal the current program display.
The [Play Editor] option allows you to record a complex movement pattern, by repeatedly logging the position of the mouse cursor as it is moved across the screen, and storing this movement data in the AMAL memory bank. The movement pattern can then be used to animate almost any Object you like! Here is the procedure for using this technique:
The vast majority of AMAL routines will normally need initialisation from the main AMOS Professional program. To make operations more convenient, the AMAL Editor includes a stripped-down version of the AMOS Professional interpreter called the Environment Generator. This allows you to perform all of the initialisation routines directly from the AMAL Editor, without the need to return to the main AMOS Professional program.
A program written with the Environment Generator can be entered from the AMAL Editor exactly as if it is a normal AMOS Professional program, as follows:
These AMAL Editor commands are similar to their AMOS Professional equivalents, except for the fact that they have been simplified to save memory. Here is a full list of commands that can be used by the AMAL Editor system:
AMAL Environment Command Notes ' REM, used at the start of a line SCREEN OPEN same as AMOS Professional SCREEN DISPLAY same as AMOS Professional SCREEN OFFSET same as AMOS Professional SCREEN same as AMOS Professional SCREEN CLOSE close all screens SCREEN CLONE same as AMOS Professional DOUBLE BUFFER same as AMOS Professional DUAL PLAY FIELD same as AMOS Professional DUAL PRIORITY same as AMOS Professional LOAD IFF "filename",screen the screen number MUST be given LOAD "filename",bank the bank number MUST be given ERASE bank same as AMOS Professional HIDE ON same as AMOS Professional UPDATE EVERY same as AMOS Professional FLASH same as AMOS Professional FLASH OFF same as AMOS Professional SET RAINBOW same as AMOS Professional RAINBOW same as AMOS Professional RAINBOW DEL delete any RAINBOW effects BOB same as AMOS Professional SET BOB same as AMOS Professional BOB OFF remove all Bobs from screen SPRITE same as AMOS Professional SPRITE OFF remove all Sprites from screen SET SPRITE BUFFER same as AMOS Professional SET REG number,value set AMAL register A to Z or 0 to 25 CHANNEL TO SPRITE channel,Sprite CHANNEL TO BOB channel,Bob CHANNEL TO SCREEN OFFSET channel,screen CHANNEL TO SCREEN SIZE channel,screen CHANNEL TO RAINBOW channel,rainbow
A range of useful Test instructions is available, and they all use the same general syntax, as follows:
INSTRUCTION condition : list of statements
The statements after the condition will only be executed if the condition is True, otherwise the following commands will be completely ignored and the program will jump directly to the next line of this Environment routine:
AMAL Environment Command Notes IF SCREEN number True if the screen has been opened IF NOT SCREEN number True if the screen is currently closed IF BANK number True if the bank has been reserved IF NOT BANK number True if the bank is not reserved IF REG number,value True if Reg A to Z or 0 to 25 equals value
To get you started, type in these texts:
E> Screen Open 0,320,200,16,Lowres Double Buffer Load "AMOSPro_Tutorial:Objects/Bobs.Abk",1 Channel To Bob 0,1 Screen 0 Bob 1,100,100,1 AMAL Channel 0 Let X=0; Let Y=0; L: Let X=X+1; Let Y=Y+1; Pause; Jump;