STOS BASIC
STOS BASIC is a scripting language for the Atari ST . It was first published by Ariolasoft in October 1989 . STOS-Basic was produced by Francois Lionet , Constantin Sotiropolus and Frédéric Pinlet under the direction of Jacues Fleurance at Mandarin Software . STOS Basic does not run under GEM and contains 340 commands.
The programming language , a BASIC dialect, specializes in game development and provides commands for the use of graphical user interfaces , graphics, music, and sprites . Animations and music can run independently of the main program. Parts of the main memory are managed as so-called memory banks, which allow the screen content or parts of it to be backed up with a single command and later restored. Individual banks are reserved for data such as sprites, icons, music or fonts.
Programming example screen
This example copies the screen content and a section to the memory bank and back again.
10 reserve as datascreen 10 20 screen copy logic to 10 (Speichert den Bildschirminhalt in Bank 10) 30 screen copy 10 to logic (Holt den Inhalt aus Bank 10 und zeigt ihn auf dem Monitor an) 40 screen copy logic,0,0,100,100 to 10,0,0 (Speichert einen Bildschirm-Ausschnitt)
Programming example sprites
This example displays, animates, and moves a sprite on the screen.
10 load "sprites.mbk" (Lädt eine ganze Gruppe Sprites in den Speicher) 20 sprite 1,100,100,6 (Zeigt Bild 6 als Sprite Nr.1 an) 30 anim 1,"(6,10)(7,10)(8,10)L" (Legt die Animationssequenz fest) 40 move x 1,"(1,3,50)(1,-3,50)" (Legt die Bewegungssequenz fest) 50 anim on 60 move on
Programming example sound
10 load "sound.mbk" (Lädt eine Datei mit Tondaten in den Speicher) 20 music 2 (Lässt die Melodie 2 abspielen) 30 tempo 10 (Reduziert die Abspielgeschwindigkeit) 40 transpose 30 (Erhöht die Tonhöhe)
Graphics commands
STOS BASIC provides 32 commands for creating graphics, including:
- ARC (circular arc)
- EARC (elliptical arc)
- BOX (empty rectangle)
- RBOX (empty rectangle with rounded corners)
- PIE (section of a circle)
- BAR (bar)
- SET LINE (set line shape)
Programming example window
10 windopen 1,0,0,9,4,4,3 (Öffnet ein Fenster) 20 title "Window Nr.1" (Setzt den Titel für das Fenster) 40 window 1 (Aktiviert Fenster 1) 50 windmove 20,20 (Verschiebt das Fenster)
Programming example menu
10 menue$ (1)="Action" 20 menue$ (2)="Mouse" 30 menue$ (2,1)="Arrow" 40 menue$ (2,2)="Hand" 50 onmenue goto 10
Program sequence commands
- GOTO
- GOSUB
- FOR / NEXT
- WHILE / WEND
- REPEAT / UNTIL
- IF / THEN / ELSE
- ON var GOTO / GOSUB (jump depending on the value of the variable)
- ON ERROR GOTO (for error handling)
- INKEY $ (keyboard query)
- INPUT
Trigonometric and Math Functions
Floating point numbers are calculated with 16 decimal places with STOS-Basic. In order to increase the speed of the programs, the accuracy can be reduced to 7 decimal places.
- DEG
- WHEEL
- SIN / ASIN / HSIN
- COS / ACOS / HCOS
- TAN / ATAN / HTAN
- PI
- LOG
- EXP
- SQR
- SECTION
- INT
- MAX / MIN
- RND
In addition, with STOS-Basic you can also use direct machine commands or call the STOS functions directly via machine language commands. In this way you can also influence the processor bit by bit. It is also possible to load more complex machine programs into the memory and call them up from the basic program.
There is also a compiler for the STOS-Basic , which converts programs written in BASIC into executable machine code programs.
Web links
- STOS: With joystick and 16 colors , Happy Computer 01/1989
- STOS - The Game Creator , ST-Computer 09/1989