home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TCE Demo 2
/
TCE_DEMO_CD2.iso
/
demo_cd_.2
/
mags
/
stosser
/
stoser08.arj
/
stoser08.msa
/
ISSUE_8
/
4.PNE
< prev
next >
Wrap
Text File
|
1987-04-22
|
10KB
|
235 lines
~~~~~~~ STOS EXTENSIONS ~~~~~~
~~~~~ ARTICLE BY DEANO ~~~~~
~~~~~ FROM THE FORTHCOMING 'COMPLETE GUIDE TO STOS' ~~~~~
In this article, I hope to shed some light on what a few people seem to
be having problems with.... STOS extensions. Various questions are
raised on the subject, what is an extension, what does it do, how do I
install it, and how is one written. Well, in this article I shall
attempt to answer these questions.
1> WHAT IS AN EXTENSION?
When Francios Lionet developed STOS, he decided that there could always
be room for improvment. In other words, fix it so extra commands could
be added. So, instead of releasing a new version of it with new commands
he fixed it so that the new commands could be an added on.
When we enter a command into STOS, it is not understood by the ST in its
basic form. It first has to be translated into a language which the ST
can understand, which is machine code. Suppose we type.....
plot 320,100,1
The assembly routine for this command would look like this.
move.I #1,-(a6)
move.I #100,-(a6)
move.I #320,-(a6)
jsr plot
If we look in the STOS folder, we will see a large selection of files.
As STOS loads, each of these files are loaded into memory, each file
contains M/C routines for each basic command entered into STOS.
For example, if we entered the above 'plot' command, STOS would look
through the BASIC.BIN file for the M/C routine for it.
STOS was written in assembly language then assembled into machine code,
which is a list of numbers called binary numbers. So the SPRITE.BIN file
contains the binary numbers for the SPRITE commands. So as we can see,
STOS is not just one large piece of code, its split into different
parts. If we remove the FLOAT.BIN file then we would'nt be able to use
floating point numbers as STOS does'nt know the machine code routine.
So, a STOS extension is just an extra file containing the command names
and machine routines like the .BIN files which is first written in
assembly then translated to machine code. STOS loads it into memory and
when we enter one of the new commands, STOS looks in the extra file and
finds the machine code routine for it, then executes it.
Sounds confusing does'nt it. Well, to use an extension this information
is not really important anyway so panic ye not.
Its likely that you've been using an extension which realising it, STOS
already has one installed in the later versions. The COMPACT extension
which gives us two extra commands....PACK and UNPACK. Load STOS and
enter the following routine....
10 key off : mode 10 key off : mode 0
20 reserve as screen 5 : reserve as screen 6
30 load"pic.pi1",5
40 pack 5,6
50 unpack 6
This routine will load a degas picture into bank five and the 'pack'
command will compress it to a smaller size then put it into bank six.
The 'unpack' command will expand the compressed picture from this bank
and copy it to the background and physic screens. Now, save this routine
to disk and exit STOS by typing 'system' to go to the desktop.
Insert the STOS disk and open the STOS folder, look through the files
for one called COMPACT.EXA. This is the file that holds the new commands
names along with the machine code routine for each one. This is the
compact extension for STOS, the interpeter version.
If we look at the three letters following the dot, we see it says EXA,
this informs STOS that it is extension A. As STOS loads, it reserves a
slot in memory for this file and names it slot A, so when it comes
across a command from this file, it looks in slot A for the command's
information and carries it out.
Lets try something, rename EXA to XXX and re-load STOS. Next, load the
compress routine we did earlier and list it. It looks like this...
10 key off : mode 10 key off : mode 0
20 reserve as screen 5 : reserve as screen 6
30 load"pic.pi1",5
40 extension #A 5,6
50 extension #A 6
Whats happened??? Wheres the PACK and UNPACK commands? Whats happened is
since we renamed the EXA part of the file STOS has'nt loaded the file
into memory..(slot A), the routine has told STOS that the command names
and routines are in the COMPACT.EXA file but as its not been loaded,
slot A is empty so STOS lists the PACK and UNPACK commands as it has in
lines 40 and 50 telling us that extension slot A is empty. We can see
this by running the program.
Type 'run' and the following will appear......
Extension not present in line 40
40 extension #A 5,6
So, in order to get the commands back we need to rename the extension
filename back to COMPACT.EXA. Reboot STOS and run the routine again and
hey presto, the commands appear back in the listing. This is because the
extension details are sat back in slot A waiting to be used.
2> HOW DO WE INSTALL AN EXTENSION?
Before we can use the new commands in an extension we first need to
install the extension. This is very simple indeed, all we need to do is
put the extension file in the STOS folder on the STOS disk. When STOS
loads up, it looks inside the STOS folder and loads each file in it, so
inside the STOS folder is the COMPACT.EXA file which STOS will load into
memory...(SLOT A), when it comes across it. The extension file that goes
in the STOS folder is called the 'interpreter' version.
Some extensions, such as MISTY, have a program supplied to install the
extension for us. We just load the program, select the right install
option and insert the right disk, other extensions just have the files
on disk leaving us to install them ourselves.
Extensions such as 'missing link' are actually cut into two or three
different extension files so that means each interpreter file has to be
put in the STOS folder in order for us to use all the commands. Lets
look at the COMPACT extension and see what the extension name means..
COMPACT.EXA
E= The file is a STOS extension
X= And it's the interpreter version
A= It is loaded in slot A
If you were installing the 'missing link' extension then you would put
these files in the STOS folder......
LINK1.EXQ
LINK2.EXR
LINK3.EXS
As you can see from this last example, each of these extension files has
a different SLOT letter...Q, R, S. If you have two extensions installed
which have the same SLOT letter then only one will load. STOS loads each
letter in alphabetical order, so it will load extension A, ignore the
next extension with the same SLOT letter and proceed onto the next
extension file it finds. As far as I know, three extensions use SLOT
letter S, these are Stos Tracker, Link3, and STOS 3D. We can't change
the SLOT letter as the file will only load into its original SLOT
number, but we can stop it from loading by renaming the file extension,
IE: the three letter name of one file to XXX.
2.1> THE STOS COMPILER
If you have a copy of the compiler then you need to know that before you
can compile a routine using new commands then you need to install the
compiler extension into the COMPILER folder on the COMPILER disk.
When we compile a program, the compiler looks for each basic command it
finds in the routine and converts it to machine code by looking at the
files in the COMPILER folder and putting the commands information into
the compiled program. So in order for our new commands to be compiled we
need to put the COMPILER version of the extension in the compiler
folder. Have a look in this folder and you will see this file.
COMPACT.ECA
This file tells the compiler that.......
E= The file is a STOS extension
C= And it is the COMPILER version
A= It is compiled into SLOT A
Try loading that routine we prepared eariler and compiling it. You'll
see that it works okay, but try changing COMPACT.ECA to COMPACT.XXX and
try compiling the routine again. The compiler reports this message...
Extension not found in line 40
Which quite simply means that the compiler can't compile the extension
because it can't find it on the disk, just rename COMPACT.XXX back to
COMPACT.ECA and everything will work fine.
Compiler users will have the compiler's own extension installed and will
see it as COMPILER.EXC and COMPILER.ECC.
3> HOW DO I WRITE AN EXTENSION
In order to write an extension we need to know how to program in
assembly language. I can't really tell you were to start and what to do
as it would be inflicting copyright as there is a book that has a
chapter on writing extensions which is called The Game Makers Manual,
which is availible from MT Software and Sigma Press.
4> WHAT EXTENSIONS ARE AVAILIBLE?
Various STOS listings found with STOSSER and PD librarys mainly use
extensions but if you have'nt got the right one installed then the
listing won't work. Some programmers mention in their listing which
extension is used but others don't bother. So for your information, here
is a list of the various extensions round at the moment....
======================================================================
STOS 3D.............STOS (.EXS).........COMPLIER (.ECS)
STE.................STOS (.EXT).........COMPILER (.ECT)
STOS MAESTRO........STOS (.EXD).........COMPILER (.ECD)
MISTY...............STOS (.EXM).........COMPILER (.ECM)
MISSING LINK........STOS (.EXQ,R,S).....COMPILER (.ECQ,R,S)
EXTRA...............STOS (.EXZ).........COMPILER (.ECZ)
STOS TRACKER........STOS (.EXS).........COMPILER (.ECS)
STARS...............STOS (.EXH).........COMPILER (.ECH)
BLITTER.............STOS (.EXE).........COMPILER (.ECE)
There may be one or two others around but these are the main ones. Each
extension loads into the solt specified by the extension but none ever
use slot B as it has a bug...
Well thats the end of this little lot. I hope it proves helpful, but
should you want to ask any questions then write to me at.....
DEANO
27 TURBARY WALK
MILNROW ROCHDALE
OL16 4JN
If I can't help, then I'll find someone who can....
This is DEANO signing off..............