AMCAF Extension V1.40 Manual  Index

Misc Commands and Functions



EXCHANGE BOB
instruction: swap the two images in the sprite bank
Exchange Bob image 1,image 2

This command simply swaps the two images image 1 and image 2 in the current sprite bank. image 1 and image 2 must exist as a valid image, otherwise an error will be reported.


EXCHANGE ICON
instruction: swap the two images in the icon bank
Exchange Icon image 1,image 2

This command simply swaps the two images image 1 and image 2 in the current icon bank. image 1 and image 2 must exist as a valid image, otherwise an error will be reported.


AUDIO LOCK
instruction: reserve the audio device
Audio Lock

When you start AMOS, the audio.device will be not informed, that AMOS wants to have the audio channels.
Due to this flaw, other programs that are running in the background can replay a sound at any time, which will irritate the AMOS sound system.
To avoid this and to be more system friendly, you can use the command Audio Lock to reserve the sound channels.
As AMOS has a bug, you'll have to do it like this:

Extremove 1     : Rem removes music extension
Trap Audio Lock : Rem reserves the audio channels
ERR=Errtrap     : Rem tests, if audio lock was successful
Extreinit 1     : Rem initializes the music extension again
Extdefault 1    : Rem calls the default routine of the extension

This Routine should be called as soon as possible and BEFORE you start to play music or sounds.
If the audio channels are already in use by any other program, ERR holds an error code, otherwise zero.

To free the channels again, you have to call Audio Free.


AUDIO FREE
instruction: free the audio device
Audio Free

Using Audio Free you can free previously allocated sound channels again.


OPEN WORKBENCH
instruction: reopen a previously closed workbench
Open Workbench

This command tries to open the workbench again, if it has been closed previously.
The Workbench screen can be closed using the AMOS command Close Workbench to get more memory.


FLUSH LIBS
instruction: free as much memory as possible
Flush Libs

This command closes all libraries, fonts and devices, which are currently not in use and tries to get as much memory as possible.
During this process the PowerPacker and the diskfont.library will be 'flushed', too.


WRITE CLI
instruction: write text into the cli window
Write Cli text$

The Write Cli instruction writes the string 'text$' into the CLI window, AMOS or your program has been start from.
If this window does not exist, no text will be output.


RESET COMPUTER
instruction: reset your computer
Reset Computer

This very dangerous instruction reboots your Amiga. Obviously, this command never returns to the program.


NOP
instruction: no effect
Nop

This 'command' has no effect et al. It's only use is for speed testing routines.


AGA DETECT
function: check if the computer has aga chipset
flag=Aga Detect

This is a simple function that checks for the existence of the AGA chipset, found in A1200, A4000 and CD³² machines.
It returns -1 (True), if the new chipset is mounted or 0 (False) if the ECS or OCS chipset are still in use.

Note that it does not check for the kickstart version only, so A2000 and A500 machines with kick 3.0 or higher will be detected as non-AGA correctly.
This function is 100% system conform and won't hack the hardware for it's result.
Therefore, if the AGA chipset had been disabled either using the boot menu or the "Setpatch NOAGA" command, it will return that no AGA is available.


SCANSTR$
function: return the name of a key
key$=Scanstr$(scancode)

This very handy function returns the name of a key according to the parameter 'scancode', which can be fetched using the AMOS Scancode function.
If there is no key for the scancode, an empty string will be returned.


COMMAND NAME$
function: return the name of the program
fname$=Command Name$

Returns the file name of the program under which AMOS or the compiled program has been started.
This is required for example to read the own Tool Types.


TOOL TYPES$
function: read the tool types of an icon
tools$=Tool Types$(filename$)

With this function you can acquire the Tool Type of an icon. The supplied file 'filename$' must not have a '.info' appended!
The various Tool Types are separated by a line feed character (Chr$(10)). So they can be printed out easily using Print.

The name of your own program can be fetched using Command Name$.


AMOS CLI
function: return the cli process number of an amos.program
n=Amos Cli

This function gives back the number of the cli process out of which the program/AMOS has been started off or zero, if AMOS has been started from Workbench.
This gives you the choice to either interpret options from the command line or from the tool types of the appropriate icon.


SPEEK
function: return a signed byte from memory
value=Speek(address)

The Speek function reads a Byte from the memory address 'address', exactly the AMOS function Peek.
However, Bit 7 is used as sign bit so the result will be a value between -128 and 127.
You are advised to use this function instead of Peek if you have poked a negative value into memory and then want to read it again.


SDEEK
function: return a signed word from memory
value=Sdeek(address)

The Sdeek function reads a Word from the EVEN memory address 'address', exactly the AMOS function Deek.
However, Bit 15 is used as sign bit so the result will be a value between -32678 and 32677.
You are advised to use this function instead of Deek if you have doked a negative value into memory and then want to read it again.


CPU
function: return the number of the fitted cpu
chip=Cpu

The cpu function returns the identification number of the central processing unit currently installed your Amiga.
This number can currently lie between 68000 to 68060. Kickstart 1.3 knows only CPUs to the 68020.


FPU
function: return the id number of an coprocessor
chip=Fpu

This function returns the number of an installed mathematic coprocessor or 0, if none is fitted. As before, Kickstart 1.3 only knows the 68881.

On 68040/68060 machines, the cpu contains the fpu, so 68040 or 68060 will be returned instead.


NFN
function: no effect
dummy=Nfn

This 'function' returns nothing useful. It's only used, like Nop, in speed testing routines.


COP POS
function: return the current address of the copper list
address=Cop Pos

If you create your own copper list, you can use this function to remember the position of the next copper instruction.
Later you can then write to this address directly to change the values of a copper instruction.