AMCAF Extension V1.40 Manual  Index

Basic Graphic Commands


AMCAF expands the basic command set of AMOS by some important commands.


BZOOM
instruction: magnify a region of the screen
Bzoom s1,x1,y1,x2,y2 To s2,x3,y3,factor

Using this command you can zoom a region on the screen to a integer multiple very fast. As result the graphics are double, four times or eight times as wide and from 1 to 15 times as high as before.
The command zooms the rectangular area from x1,y1 to x2,y2 on screen s1 onto the screen s2 at the coordinates x3,y3. The ending coordinates result from the zooming factor.

The coordinates x1 and x2 are rounded down to the next multiple of eight, x3 is even rounded to the nearest multiple of 16. Moreover, you must ensure that the area to be zoomed fits on the target screen, because no clipping is done at all.

The factor parameter defines how much the original image should be zoomed. It is divided into two nibbles: $yx. y may be a value from 1 to F, x must be either 1,2,4 or 8.

Example factors:
$11 copies the image without zooming.
$22 zooms the picture to double width and height.
$34 zooms the graphics to 4 times width and 3 times height.

HAM FADE OUT
instruction: fade out a screen
Ham Fade Out screen number

As HAM screens cannot be faded out with the normal Fade commands, AMCAF provides you with a HAM fader!
Although you can only fade out pictures.
Ham Fade Out darkens the screen by one single step. After calling it 16 times, the Ham screen is completely black.
Technically, it's not possible to fade in a ham screen without enormous processor power, but for fading out, a modified Shade Bobs routine is used.


CONVERT GREY
instruction: convert a screen to grayscale
Convert Grey sourcescreen To targetscreen

Using this command you can convert any screen into a grey scale image, even HAM and ExtraHalfBright screens are supported.
The only thing you have to do, is to open the screen and set the correct palette.

The parameter 'sourcescreen' defines the screen to be grey scaled, 'targetscreen' is the number of the screen where the grey image is to be created on.
The number of colours in the target screen will be taken in account, but it makes no sense to open a HAM screen for that purpose.


TURBO PLOT
instruction: draw a dot on the screen
Turbo Plot x,y,c

Draws a dot at the coordinates x,y using the colour 'c'.
This command is about 3-14 factors faster than the AMOS plot command, but does not care about logical combinations which could be defined with Gr Writing.


TURBO DRAW
instruction: draw a line on the screen
Turbo Draw x1,y1 To x2,y2,c
Turbo Draw x1,y1 To x2,y2,c,bitplanes

This instruction replaces the AMOS Draw command. The x1,y1 coordinates represent the starting point of the line and x2,y2 the ending point.
The coordinates needn't to be on the screen, the line is clipped automatically.

The colour of the line 'c' must be given, whereas the 'bitplanes' parameter is optional. It determines, into which Bitplanes the line should be drawn.
So Bit 0 represents bitplane 0, bit 1 represents bitplane 1 etc. If the corresponding bit is set, a line will be drawn in the bitplane, otherwise not.
If 'bitplanes' is omitted, every bitplane is drawn into. Turbo Draw supports a line pattern, which can be changed using the AMOS Set Line command.

With Turbo Draw, you can draw even more and special lines, so-called Blitter Lines. These lines are only drawn with one dot in each horizontal line and are used to create polygons which can then be filled with the blitter chip.
To switch to this mode, the 'bitplane' parameter must be given as negative number, everything else can remain as it is.
Please note that an extra line is drawn automatically if the blitter line leaves the right boundary of the screen.


FCIRCLE
instruction: draw a filled circle on the screen
Fcircle x,y,r

Fcircle is a command which has been missed in AMOS for a long time. It draws a filled circle with the radius 'r' and center x,y.


FELLIPSE
instruction: draw a filled ellipse on the screen
Fellipse x,y,rx,ry

This command draws an ellipse, similar to the AMOS Ellipse command. However, Fellipse draws a filled ellipse.


RASTER WAIT
instruction: wait for the raster beam position
Raster Wait y
Raster Wait x,y

This command can be used to wait for a specific position of the raster beam.
The x and y parameters contain the hardware coordinates from which the program should continue.


Basic Graphic Functions

TURBO POINT
function: return the colour of a pixel
c=Turbo Point(x,y)

This functions requests the colour of the pixel at the coordinates x,y. It is much faster than the normal Point instruction.


X RASTER
function: return the current X position of the raster beam
x=X Raster

This function returns the current X position of the raster beam in hardware coordinates.
This value is not very accurate because the raster beam is very fast, sigh.


Y RASTER
function: return the current Y position of the raster beam
y=Y Raster

Y Raster returns the current Y position of the raster beam.
This function can be used to see how many raster lines a specific part of a program takes.