As it’s name suggests – the Extra extension provides something a little extra. Improved commands and a few you may find useful. Without further ado let’s get started.
Typing this command displays a list of commands the extra extension provides. Useful if you want a quick way of checking how a certain command works.
Same command but prints the command list to printer rather than screen.
Check to see if your printer is ready to print. Returns a value of -1 when ready and 0 when it isn’t.
20 home : print “Waiting for Printer”
30 until prntr=-1
40 print “Printer is ready”
It does just what it says – it dumps (prints) a picture on screen onto your printer, the same as the STOS hardcopy command.
10 mode 0 : key off : hide : curs off : flash off
20 if prntr=0 then print”Press the online switch.”
30 if prntr=-1 then screen dump
40 goto 20
This command unpacks pictures in TINY format (TN1). Been known to clash with the Depack command from the Missing Link extention. Disable Missing Link if you want to use this command.
In order to unpack a TINY picture you must first reserve a bank to the size of the TINY picture then BLOAD it in.
reserve as work 5,9000 : bload”PIC.TN1″,5
You can then choose to unpack it to the screen or a screen bank.
depack tiny start(5),physic or depack tiny start(5),start(6)
This command simply converts an IFF picture file to a PI1 or NEO picture file. The IFF file must be unpacked. The command is…
convert iff start(5),physic,palst
This line converts the IFF picture in bank five and unpacks it to the screen which is used as workspace, you can also use a screen bank instead of a screen. The PALST value is used to decide whether you want to get the palette of the picture. Values are 0 for “don’t get palette” or 1 for “get palette”.
When broadcasters don’t want you to see something on television they block it out using a jumbled pixel effect. The blur command allows you to do the same. The command looks like this.
ADDRESS: Can be a screen (IE:physic) or a memory bank.
XPOS AND YPOS: The X and Y co-ordinates of the block of the picture to be blurred.
XBLOCK AND YBLOCK: The size of the block to be blurred.
XSIZE AND YSIZE: The size of each zoomed pixel that makes up the block.
TYPE: Tells the command which pixel to use to get the colour of the resulting block – ranges from 1 to 5.
The DESHADE command changes all the colours at ADDRESS which can be a screen,or a bank, to COLOUR. The IGNORE value allows you to specify which colour in your palette is not to be changed.
10 key off: mode 0
30 deshade physic,0,6
HREV allows you to flip a picture in a string horizontally. The picture block must first be put in a string (S$) with SCREEN$.
10 key off: curs off : mode 0
20 S$=screen$(5,32,32 to 112,100)
30 hrev S$
As HREV but flips the screen vertically.
PPSC (pixel perfect screen copy)
This command works like Screen copy only that it allows you to copy pictures anywhere on screen, it is not limited by the ST’s sixteen pixel boundary problem. Can become quite slow when copying large areas of screen.
The Plane parameter allows you to choose how many screen plans to draw the picture in. It’s usually set to four for the full set. The Source can be a screen or a bank where you copy from and Des is the destination of the screen – again a screen or a bank.
fmt disk drive,size,buffer
This command allows you to format a disk to different sectors. DRIVE is 0 for drive A or 1 for Drive B. SIDES can be 0 (single sided) or 1 (double sided). BUFFER is a memory bank reserved to at least 5000 bytes for the command to use as its workspace.
set screen HZ Hertz
This command works like the Frequency command in STOS only this command will work fine in a compiled program. Hertz can be 50 or 60.
Every time a new ST comes out, its TOS is updated. OS VERSION$ is a variable that finds out what the TOS version of your ST is. You use it by letting a variable equal it using the VAL command to find this out. For example, lets use a line that checks if your ST has TOS 1.62.
10 OS#=val(os version$)
20 if OS#=1.62 then print”You have an STE with TOS 1.62″
This command is used to tell you how much memory your ST has in Kilobytes. Usually the ST measures memory in bytes rather than K so a one meg ST will have around 800000 or something like that. It works by taking the number of bytes of memory your machine has and dividing it by 1024, which is the size of a Kilobyte in bytes. Try this routine.
20 print D
This routine tells you how much memory you have in K’s (Kilobytes). However the “free” command takes away the memory that’s been used by STOS and anything loaded in. But “mem config” tells you how much memory in K you have altogether without anything taking it up. It goes like this.
10 D=mem config
20 print “The total K of memory on this ST is “;D
If you have a sampler cartridge then you can create some nice disco effects with this command. It’s a variable which returns the value from the cartridge between 0 and 255. You could use it to create a simple VU meter like this.
10 key off : hide on : flash off : mode 0 : curs off
30 X=cartridge input-127
40 ink rnd(14)+1
50 cls logic
60 bar 0,0 to X,20
70 screen swap : wait vbl
80 goto 30
So in this case, the higher the value the longer the bar will go. Note you have to always subtract 127 so that nought becomes stable.
The POWER command is a new faster and more trusted version of the ^ symbol. The idea is to multiply a number so many times against itself. Lets take this example.
Each sum gives us the answer 243. What it does is take a number and raise it to the power of another number. So in the last example we are multiplying three to the power of five (3^5) which is the same as the second example but shorter reading and faster. So to do this with the POWER command we just go.
Which is the same as…
The next command is…
disc size (DRIVE)
This command is similar to the DFREE command only it returns the total size of the disk. If you had a file on disk which was 49000 bytes long then DFREE would return the space left on the disk minus 49000 bytes. Where DISC SIZE returns the size of the disk itself in bytes rather than report the free space left on disk.
10 D=disc free(0)
20 if D=802300 then print”This disk is 802300 bytes in length”
It’s useful if you wanted to check if an inserted disk is a nine sector disk by getting the size of the disk in bytes and if DISC FREE returns that number then its a nine sector disk. The DRIVE parameter has two values. That’s 0 to check the disk in drive A and 1 to check the disk in drive B.
disc free (DRIVE)
This is just the same as DFREE only it allows you to check a certain drive.
10 D=disc free(1)
20 print D;”bytes free on disk B”
EXTRA is not the best extension out there but it does have some commands you will find useful. You can download it here along with other extensions.