Using these commands you can increase or decrease the colour indexes in a
rectangular area.
These instructions work pixel wise and therefore makes it possible to limit the colours, and so the Pix Shift commands are slower
than Shade Bobs.
MASK COPY
instruction: copy an area of a screen to another screen
Mask Copy screen1,x1,y1,x2,y2 To screen2,x3,y3,maskaddress
Copies a part of a screen to an other, just like Screen Copy.
However, a mask bitplane can be given. 'maskaddress' represents the startaddress of
the Bitplane.
PIX SHIFT UP
instruction: increase the colour index of an area of a screen
Pix Shift Up screen,c1,c2,x1,y1 To x2,y2
Pix Shift Up screen,c1,c2,x1,y1 To x2,y2,bank
Using this command, you can increase the colour indexes in the rectangular
area from x1,y1 to x2y2.
The 'screen' parameter therefore contains the number of the screen on which this regions is situated.
'c1' and 'c2' hold the border colours, which should be taken into account for the colour
cycling, other colours are not affected.
If you supply the optional parameter 'bank', you can use a previously
calculated mask which can be created with the Make Pix Mask command.
However, if the colour indexes override 'c2', they are set back to 'c1' again.
PIX SHIFT DOWN
instruction: decrease the colour index of an area of a screen
Pix Shift Down screen,c1,c2,x1,y1 To x2,y2
Pix Shift Down screen,c1,c2,x1,y1 To x2,y2,bank
Using this command, you can decrease the colour indexes in the rectangular
area from x1,y1 to x2y2.
The 'screen' parameter therefore contains the number of the screen on which this regions is situated.
'c1' and 'c2' hold the border colours, which should be taken into account for the colour
cycling, other colours are not affected.
If you supply the optional parameter 'bank', you can use a previously
calculated mask which can be created with the Make Pix Mask command.
However, if the colour indexes go below 'c1', they are set back to 'c2' again.
PIX BRIGHTEN
instruction: increase the colour index of an area of a screen
Pix Brighten screen,c1,c2,x1,y1 To x2,y2
Pix Brighten screen,c1,c2,x1,y1 To x2,y2,bank
Using this command, you can increase the colour indexes in the rectangular
area from x1,y1 to x2y2.
The 'screen' parameter therefore contains the number of the screen on which this regions is situated.
'c1' and 'c2' hold the border colours, which should be taken into account for the colour
cycling, other colours are not affected.
If you supply the optional parameter 'bank', you can use a previously
calculated mask which can be created with the Make Pix Mask command.
In difference to Pix Shift Up, the colour indexes don't override 'c2'.
PIX DARKEN
instruction: decrease the colour index of an area of a screen
Pix Darken screen,c1,c2,x1,y1 To x2,y2
Pix Darken screen,c1,c2,x1,y1 To x2,y2,bank
Using this command, you can decrease the colour indexes in the rectangular
area from x1,y1 to x2y2.
The 'screen' parameter therefore contains the number of the screen on which this regions is situated.
'c1' and 'c2' hold the border colours, which should be taken into account for the colour
cycling, other colours are not affected.
If you supply the optional parameter 'bank', you can use a previously
calculated mask which can be created with the Make Pix Mask command.
In difference to Pix Shift Down, the colour indexes don't go below 'c1'.
MAKE PIX MASK
instruction: grab an area of a screen
Make Pix Mask screen,x1,y1 To x2,y2,bank
Grabs a specific part of the screen and saves it into the bank with the
number bank. This command can be used to create a mask for the Pix Shift
instruction.
If you use such a mask, the size must be exactly the same like the limits you specify with the Pix Shift commands.
SHADE PIX
instruction: increase the colour value at the given point of a screen
Shade Pix x,y
Shade Pix x,y,number
This instructions increases the colour value at the given point x,y on the current screen.
If the highest colour is reached, the colour is reset to zero.
The optional parameter 'number' holds the number of Bitplanes
to be cycled and may range from 1 to 6.
Shade Bobs aren't really bobs, but "in the scene" this is the common name
for such effects. Shade Bobs increase or decrease colour values of the
pixel they are placed on. This is rather similar to colour cycling,
however using Shade Bobs the pixels on the screen are affected and not the
palette entries!
When using Shade Bobs you cannot limit the colours to a
certain range but only the amount of bitplanes that will be used to be
cycled through. Additionally, Shade Bobs may leave the screen boundaries.
SHADE BOB MASK
instruction: set image to use on shade bob
Shade Bob Mask flag
Using Shade Bob Mask you may specify, if the mask of a object or the first
bitplane is to be taken for drawing.
If flag is set to zero, bitplane 0 is used for the Shade Bob Up and Shade Bob Down instructions, other values
for flag instruct the commands to use the mask of the object.
SHADE BOB PLANES
instruction: set number of bitplanes to use on shade bob
Shade Bob Planes number
Set the number of Bitplanes to be cycled through. This can be used to
protect the graphics in higher bitplanes from the influences of Shade
Bobs.
'number' sets the number of bitplanes, that should be drawn in and must be a value between 1 and 6.
SHADE BOB UP
instruction: increase the colour index and draw a shade bob
Shade Bob Up screen number,x,y,image
This instruction draws a Shade Bob on the screen at the coordinates x,y. This bob only increases the colour indexes only. 'image'
holds the image number of the sprite bank which should be used to draw the bob.
Either the mask or the first bitplane of the object is used for this
process, according to the setting of Shade Bob Mask.
Remember, that this command supports the hot spot of the bob image.
SHADE BOB DOWN
instruction: decrease the colour index and draw a shade bob
Shade Bob Down screen number,x,y,image
This command is similar to Shade Bob Up and decreases the colour index only.
Using these commands you not only can realize 3D star effects, because the commands are rather versatile.
TD STARS BANK
instruction: reserve a bank for 3d stars
Td Stars Bank bank,stars
This instruction reserves a bank for 3D stars. The 'bank' parameter holds
the number of the memory bank which should be used for the stars. 'stars'
contains the number of stars to be saved in this bank.
Each star consumes 12 bytes of memory.
TD STARS PLANES
instruction: set the bitplanes to use for 3d stars
Td Stars Planes bitplane 1,bitplane 2
Td Stars Planes is used to specify the Bitplanes which the stars should
be drawn on.
Normally, these are the bitplanes 0 and 1, but these defaults can be modified with this instruction.
TD STARS LIMIT
instruction: limit the area of a screen to use for 3d stars
Td Stars Limit
Td Stars Limit x1,y1 To x2,y2
Limits the stars into a specific area on the screen. If no parameters are
given, the full screen sizes are used.
x1,y1 and x2,y2 create a rectangular region, in which the stars will be
drawn in.
These coordinates must lie WITHIN the screen dimensions, otherwise the stars could corrupt your memory.
TD STARS ORIGIN
instruction: set the starting point for 3d stars
Td Stars Origin x,y
Sets the origin, where stars start from, as soon as they have left the screen. The coordinates x,y must lie on the screen and within the drawing area, you have defined using Td Stars Limit earlier.
The Td Stars Limit instruction automatically places the origin in the middle of the specified area. Therefore, this command has to be placed after Td Stars Limit.
TD STARS GRAVITY
instruction: set the direction for 3d stars
Td Stars Gravity sx,sy
Set the direction which the stars shall drift into. 'sx' contains a value which is added each step to the horizontal speed and may be a positive number for right drift or a negative one for left movement. Same with 'sy', but this one has effect on the vertical speed.
Normally, these values are set to 0, but you could use other values in conjunction with Td Stars Accelerate to create an effect of spreading sparks.
TD STARS ACCELERATE
instruction: toggle acceleration for 3d stars on or off
Td Stars Accelerate On
Td Stars Accelerate Off
Determines, if the stars are to be accelerated during the flight.
TD STARS INIT
instruction: initialise the 3d stars
Td Stars Init
Initialises the stars. That means, that the stars are moved by random
values to avoid that they all start in the origin.
This command should therefore be called once after all parameters have been set.
TD STARS SINGLE DO
TD STARS DOUBLE DO
instruction: process and draw the 3d stars
Td Stars Single Do
Td Stars Double Do
Clears, draws and moves all the stars in one single step. For Double
Buffered screens you have to call the command Td Stars Double Do, for normal ones Td Stars Single Do.
To manually control the draw process you have to call the commands Td Stars Single Del
or Td Stars Double Del, then Td Stars Move and Td Stars Draw in this order.
TD STARS SINGLE DEL
TD STARS DOUBLE DEL
instruction: delete the 3d stars from the screen
Td Stars Single Del
Td Stars Double Del
Wipes the stars from the screen. You have to distinguish between Single
and Double Buffered screens. Use Td Stars Double Del on Double Buffered
Note: The background is not saved during the drawing process.
TD STARS MOVE
instruction: move the 3d stars on the screen
Td Stars Move
Td Stars Move star number
The Td Stars Move instruction moves all the stars by on step. To see the
result, you have to draw the stars with a call to Td Stars Draw.
The second version of this command enables you to move a single star.
TD STARS DRAW
instruction: draw the 3d stars to the screen
Td Stars Draw
This command draws all the stars onto screen. To clear the stars again you have to use either Td Stars Single Del or Td Stars Double Del according to the screen type.
Splinters are similar to Td Stars, but they don't destroy the background
and use the colour of the pixel they have removed and Splinters require a
list of coordinates.
Each coordinate requires four bytes, i.e already a field of 16x16 coordinates consumes 16 KB of memory.
COORDS BANK
instruction: reserve a bank to store coords
Coords Bank bank number,coords
Coords Bank bank number
Reserves the bank to store a coordinates array. These banks are utilized e.g for Splinters. 'coords' holds the amount of
coordinates the bank should be able to hold.
Each coordinate requires 4 bytes. If this parameter is omitted the existing bank will only be
switched to without erasing it. So you can jump between predefined banks.
COORDS READ
instruction: read coords into a bank
Coords Read screen,colour,x1,y1 To x2,y2,bank,mode
Read the coordinates for Splinters into a bank. The memory bank with the number 'bank' must have been defined
previously with a call to the Coords Bank command.
The 'screen' parameter holds the number of the screen on which the pixels are. 'colour'
represents the background colour, that will be left out when reading in
the dots.
The rectangle which is described by the coordinates x1,y1 and
x2,y2 will be then read in and all dots, which don't have the colour
'colour', will be stored in the bank.
'mode' can be either 0, if you want the coords to be read in strict order, or 1, if you want the coords to be shuffled.
SPLINTERS BANK
instruction: reserve a set number of splinters into a bank
Splinters Bank bank number,splinum
Reserves a memory bank for a maximum of 'splinum' Splinters. Each Splinter requires 22 bytes of memory.
SPLINTERS COLOUR
instruction: set splinter colour to use
Splinters Colour bkcolour,planes
Determines, which colour is to be left, after a Splinter has released
a dot from that point. The 'planes' parameter describes the number of
bitplanes to be taken for the Splinters operation.
Normally, this value should be equal to the number of available bitplanes. However, it can be
useful for some effects to reduce this value.
SPLINTERS LIMIT
instruction: limit splinter area on the screen
Splinters Limit
Splinters Limit x1,y1 To x2,y2
Sets the limits for the Splinters to a rectangular area on the screen. If you don't give any parameters, AMCAF uses the limits of the current screen.
SPLINTERS MAX
instruction: change max number of splinters
Splinters Max number
Changes the max. number of new Splinters to appear on each step.
Therefore a pulsing effect can be avoided.
If the number is set to 0, no more Splinters are created. When set to -1, there won't be a limit.
SPLINTERS FUEL
instruction: set the time for splinters on screen
Splinters Fuel time
This command is used to set the amount of time the Splinters move over the
screen until they disappear automatically.
The 'time' parameter holds the number of steps the splinters are moved before they vanish. If you set
'time' to 0, the Splinters only disappear at the edges of the screen.
SPLINTERS GRAVITY
instruction: set the direction for splinters on screen
Splinters Gravity sx,sy
Set the direction which the Splinters shall drift into. 'sx' contains a
value which is added each step to the horizontal speed and may be a
positive number for right drift or a negative one for left movement.
Same with 'sy', but this one has effect on the vertical speed.
SPLINTERS INIT
instruction: initialise the splinters
Splinters Init
Initialises the Splinters. They are fed with the coordinates and speeds you have specified earlier.
SPLINTERS SINGLE DO
SPLINTERS DOUBLE DO
instruction: draw the splinters to the screen
Splinters Single Do
Splinters Double Do
Clears, draws and moves all Splinters in one single step.
For Double Buffered screens you have to call the command Splinters Double Do,
for normal ones Splinters Single Do.
To manually control the draw process you have to call the commands Splinters Single Del
or Splinters Double Del, then Splinters Move, Splinters Back and Splinters Draw in this order.
SPLINTERS SINGLE DEL
SPLINTERS DOUBLE DEL
instruction: clear the splinters from the screen
Splinters Single Del
Splinters Double Del
Clears the splinters from the screen again. As the clearing process
must either wipe the pre-last pixels from the screen (when using Double
Buffering), or the last pixels (with Single Buffered screens), you have
to take the appropriate command for the right screen type.
The background is automatically restored.
SPLINTERS MOVE
instruction: move the splinters on the screen
Splinters Move
This command moves the Splinters one step.
SPLINTERS DRAW
instruction: draw the splinters onto the screen
Splinters Draw
Draws the Splinters onto the screen.
SPLINTERS BACK
instruction: save the background for next splinter draw operation
Splinters Back
Saves the background, on which the Splinters are to be drawn in the next step.
COUNT PIXELS
function: count the number of pixels in an area
number=Count Pixels(screen number,colour,x1,y1 To x2,y2)
This function returns the number of pixels in the rectangular area from x1,y1 to x2,y2 in the screen, that don't have the colour index colour.
This function can be used to first acquire the number of points in this area and then to reserve a coordinates bank.
SPLINTERS ACTIVE
function: return the number of active splinters
number=Splinters Active
This function returns the number of active Splinters at this time. This can be used to know when the animation has finished.