programming page


Under construction This page is under construction. Under construction

x>> About STOS <x>

STOS BASIC is a dialect of the BASIC programming language for the Atari ST that is suited for creating games and other multimedia applications. The functionality of STOS can be extend by adding extensions which added more commands to the language and increased the functionality.

Originally developped by Jawx, and released in the UK 1988 by Mandarin Software, it developed a dedicated following, and is still around today. The source-code to STOS has recently been released.

x>> One-liners <x>

Here we have some one-liners - complete games written in one line of STOS BASIC!

There are currently two - Green Things From Mars and Line C 1 6P (a 6 palyer no-AI version of Line Crash for STEs and above).

A trick to use is the property that expressions have of resolving to a Boolean value. A statement such as (A>B) resolves to true if A>B or false if A<=B. As the value of true is -1 and false is 0, these values can be used in arithmetical expressions. An example follows:
Y=Y+(jup-jdown) and not(ISDEAD)
Here, the change in the Y direction (known as the Y-delta) is worked out by subtracting the joystick-Boolean-value jdown from jup. The Y-delta is then added to the Y position. not(ISDEAD) resolves to -1 if ISDEAD=false, and and'ing anything with -1 returns the same value (-1 means all bits in an integer-value are set). But if ISDEAD=true, then and'ing not(ISDEAD) with the Y-delta always produces 0.

Green Things From Mars (1989)
In Green Things From Mars, the aim is to say alive by avoiding the enemies for as long as possible. Before the game is executed, it requires that the mode is set to low-resolution first, and that the screen is cleared between games.

1 dim A(15),B(15) : X=160 : Y=100 : set mark 3,17 : for T=1 to 15 : A(T)=rnd(250)+25 : B(T)=rnd(140)+40 : next T : repeat : ink 0 : for T=1 to 15 : ink 0 : K=A(T) : L=B(T) : polymark K,L : Q=(K>X)-(K<X) : R=(L>Y)-(L<Y) : K=K+rnd(2)-1+Q : L=L+rnd(2)-1+R : ink 11 : polymark K,L : A(T)=K : B(T)=L : next T : Q=(jleft)-(jright) : R=(jup)-(jdown) : C=point(X,Y) : ink 0 : polymark X,Y : X=X+Q : Y=Y+R : ink 10 : polymark X,Y : until C=11 : boom
Yes, I know about the redundant ink 0 statement. I just wanted to preserve the original version.

Green Things From Mars does not require any extensions. It was written with just the original STOS commands.

Line C 1 6P (1992)
This is an STE and above one-line version of Line Crash. As well as not being as fancy as it's big brother, it is only for 6 players and does not have any AI, and the joystick has to be held down continuously right from the start or the line will stop and die.

1 dim X(6),Y(6),D(6) : sticks on : mode 0 : key off : flash off : hide on : palette $0,$777,$700,$770,$70,$77,$7,$707 : ink 1 : box 0,9 to 319,199 : for T=1 to 6 : X(T)=45*T : Y(T)=100 : next T : repeat : S=0 : L#=0 : for T=1 to 6 : X(T)=X(T)-(l stick(T)-r stick(T))*not(D(T)) : Y(T)=Y(T)-(u stick(T)-d stick(T))*not(D(T)) : D(T)=(point(X(T),Y(T))<>0) : ink T+1 : S=S+D(T) : L#=L#+10^(-T*(D(T)=0)) : plot X(T),Y(T) : next T : until S<=-5 : pen log(L#)+1 : print "winner"

Line C 1 6P requires the STE extension as extension #F (any extension # will do if running the ASCII version).

*STOS Basic Sourcecode* On the downloads page, you can download both the 1-liners in .BAS format.

x>> Extra Joysticks <x>

Give your games some extra joy - plug in some extra joysticks!

On the downloads page, you can find a .ZIP file containing the instructions for how to build adaptors for plugging extra joysticks into your ST or STE. It also contains some STOS BASIC sourcecode (in an ASCII file-format) for accessing them (the code can easily be converted to another language). However, there are some STOS extensions that add commands to access these extra joysticks that make the included code redundant. The STE Extension reads the STE joystick-port joysticks and the Control Extension reads the paralell-port joysticks.

The extra joystick adaptors come in two varieties. A paralell-port (Centronics) adaptor (which takes two joysticks) and an STE joystick-port adaptor (which takes two joysticks). The latter can only be plugged into STE/TT/Falcon machines. There is one paralell-port and two STE joystick ports. Combine this with the two standard ST joystick ports, and a total of eight joysticks can be plugged in (or four if the machine is not a STE/TT/Falcon).

x>> Other STOS-based projects <x>

Here are a few more things Wacko Software have been doing with STOS BASIC that are mentioned on the main Wacko Software homepage.

The STOS Gamescomposer version 1.80m+
You just got STOS and you ran out of ideas, then press RETURN for an idea. This Artificial Insanity program will generate game-ideas for you.
Comes with source.
Sourcecode requires the STOS Maestro extension as extension #D

The STOS Slideshow version 1.04
Show off your Degas and Neochrome pictures with some amazing effects.
Comes with source.
The STE/TT/Falcon makes use of the extra STE colours to create a black and white image with more levels of grey when displaying the image in monochrome.

The STOS Re-writer version 1.02f
Another example of Artificial Insanity. This time, the computer can write insane stories, poems, etc. by filling in the blanks with noun, verb, adjective, etc. from it's vocabulary.
Comes with source.

Buy and selling comodities to earn enough money to escape from the planet. Our worst game ever.
Comes with source.
Sourcecode requires the PICTURE COMPACTOR extension as extension #A

The game isn't 3D, but at least you get to ski. You race 2 opponents on some ski paths, but you must take care not to collide with rocks, fall off the edge, or take a path leading to a dead end.
Comes with source.
Sourcecode requires the PICTURE COMPACTOR extension as extension #A

This game is a re-make of the Atari 8-bit game Mr.Robot.
Comes with source.
Sourcecode requires the PICTURE COMPACTOR extension as extension #A

Mazewar ST
A conversion from the Atari 8-bit version of the game Mazewar. Our first ever eight-player game.

Joseph's Holiday
A one-screen demo with a few chip-songs and a digi-drum song, and amusing VU-meters. We were originally hoping this screen would become part of a STOS mega-demo, but instead, it was released by itself a year later.

Line Crash
This is similar to Tron/Lightcycles where you have to trap your opponents in a beam of light by forcing them to crash into either your beam or somebody else's. Another eight-player game.

Video Games I version 0.5
Play 3 classic games on the same computer simultaneously. The Atari ST version was programmed in STOS. The STOS code makes use of the Misty extension so that the graphics can be manipulated on a bit-plane level (this is how the colours are merged). This does not include the source, but it may be released someday.

Pacman for up to EIGHT players. As well as chasing or avoiding ghosts and eating pills, you can shoot missiles at the other players.

x>> Links to other sites <x>

Web-rings and banners



For more general-purpose programming/software-related links, see the links sections of the Wacko Software homepage.

x>> Feedback <x>

E-MAIL  Feedback:
Use this link to leave some feedback for this webpage.

Last update: Mon 31 Jul 2006

Back to Wacko Software's homepage