A New Basic For the Atari -- Basic A+
Mike Dunn
Atari Basic was originally written by Optimized Systems Software, at the time a division of Shepardson Microsystems. There have been two patterns of Basic in microcomputers originating from Hewlett-Packard and Digital Equipment Corp. Bucking the trend toward the DEC orientated Microsoft dialect, Atari Basic was patterned after the Hewlett-Packard model, as were NorthStar and Cromemco Basics. Contained in an 8K ROM cartridge, the Atari now has some new Basic's available. One is Microsoft Basic and the other is an extension of the original by Optimized Systems Software, now an independent company. This article is about OSS's new Basic A+ and Disk operating system, OS/A+, both written by the same individuals who wrote the original Atari Basic.
The new Basic adds 5K of new features to the original Basic, with a total of 43 new statements and functions. Basic A+ is a structured Basic and has many user-oriented features that make your Atari easier to use. The statements IF..THAN..ENDIF and WHILE..ENDWHILE help you write programs in a structured style, and the listings produced will automatically be displayed with the proper indents. Nested loops are easily followed. Lower case and inverse characters can be used for commands, but LIST in upper case.
For business use an extensive PRINT USING capability as well as a TAB functions are included. There are commands for developing fixed length records for random access files, and an INPUT".." statement that allows you to specify the prompt displayed; it is also self-trapping so it will automatically reprompt if the input given is in error. Other improvements include the ability to use subscript with INPUT and READ statements, and added string handling functions such as string concatenation using "." and new commands such as FIND that search for a particular substring. Aiding in program development are TRACE functions, SET and SYS commands that allow easy changing of default values instead of POKEs, meaningful error messages instead of numbers, and the ability to call up the disk directory easily in Basic. "IF ERR" instructions can he used to test errors and direct the program flow. You can DELete any lines between two numbers and easily move back and forth between Basic and Assembly Language with several special commands. Two-byte words are directly accessible with DPEEK and DPOKE functions. All the variables used in the program can he instantly listed, and all the usual Disk commands are directly available.
The most exciting feature is the extensive set of Player-Missile Graphic commands that make using these special functions as easy to use as PLOT and DRAWTO with regular graphics. The Atari comes with 9 graphics modes, with various amounts of resolution and numbers of colors available. Independent of this system called the playfield, is a system of Graphics called Player-Missile Graphics, that allow incredible feats such as overlays with user defined priorities, machine speed graphics, collision registers, shape tables. These special effects that can be seen in Atari games such as Star Raiders. With Atari Basic, using PEEKs and POKEs and machine language subroutines, these special hardware registers can be accessed, but with Basic A+, simple Basic commands allow you to use this system with ease. There are 14 of these commands available for use, as well as new integrated joystick commands that simplify Joystick use. These joystick commands also make the movements "silky" in feel and much smoother than found in even the ROM Atari Games.
Program number 1 listed in this article is similar to the one by Chris Crawford of Atari, Inc., published in January 81 "Compute" magazine. In that article, Chris explained how to use Player Missile Graphics by defining a space ship and moving it around the screen with a joystick. The shape table made first by a binary image, is then converted to Hex and then to decimal. The Shooting of missiles is also demonstrated in this article. Some important features illustrated in the program listed here include the format that the listing is printed in, as this is the way the program actually appears on the screen. The commands that begin "PM..." ...are some of the special Player-Missile graphic commands of Basic A+. Line 100 begins the WHILE... ENDWHILE loop and will execute as long as WHILE is non-zero. Also note the simple commands to use the joystick. Line 110 moves the spaceship around the screen. The second program draws the same spaceship, then shoots missiles. The BUMP command on line 260 access the collision registers, as many lines between IF... ENDIF as you wish.
Basic A+ comes on a disk, and can be easily changed by a FIXER program if "bugs" are discovered. In the future, many other useful items are planned to further enhance Basic A+. An APPLE version is also planned, compatible with the Atari version, so programs from one will work on the other (except, of course, hardware dependent features such as Player- Missile Graphics).
A new disk operating system called OS/A+ has been also released as an independent but integrated part of the package. It includes an Assembler, as well as many utilities in a command oriented format rather than the menu driven format of the Atari DOS. BATCH processing data via EXECUTE files makes the Disk system more powerful than ever before, as it allows the user to string together a series of programs, and a STARTUP.EXC command allows you to specify any file to be run on booting the disk. OS/A+ is compatible with the Atari DOS II and the Basic cartridge.
Basic A+ costs $80.00 and OS/A+ is also $80.00 while the set is $150.00. Either works independently of the other, but the set is an ideal combination. The advantages are many; the disadvantages include the inability to use Atari LOAD (tokenized) files without first LISTing them, and the inability to share your masterpieces with other Atari owners unless they have this Basic. Software developers can get a "runtime" master Basic A+ to include with their programs for a one-time license fee, regardless of the number of copies they sell. Of course, the main competitor to this package will be Atari's Microsoft Basic. The advantages of Microsoft are well known, including the huge amount of published software available, but Microsoft does not have the powerful structured commands available in A+. It does also include a set of player-missile graphics commands. For me, the ease of use of Player-Missile graphics, and the ability to easily interface machine language programs with Basic justify the expense of O.S.S.'s products.
Listing 1.
5 GRAPHICS 0 10 SETCOLOR 2,0,0:V=48:H=60 20 PMGRAPHICS 2 30 WIDTH=1 50 PMCLR 0 60 PMCOLOR 0,13,8 70 P0=FMADR(0) 75 FOR ADDR=P0+V TO P0+V+4:REM DRAW PLAYER 85 READ DATA:POKE ADDR,DATA 87 NEXT ADDR 90 REM MOTION ROUTINE 100 WHILE 1:REM FOREVER 110 VS=VSTICK(0):HS=HSTICK(0) 120 H=H+HS:V=V-VS:PMMOVE 0,H;VS 130 ENDWHILE 200 DATA 153,189,255,189,153
Listing 2.
100 GRAPHICS 4:PMGRAPHICS 2:PMCLR 0:PMCLR 4 110 V=48:H=60:SET 7,1 120 COLOR 3:PLOT 70,10:DRAWTO 70,14 150 SETCOLOR 0,4,12:PMCOLOR 0,13,8 160 P0=PMADR(0) 170 FOR ADDR=P0+V TO P0+V+4 180 READ DATA:POKE ADDR,DATA 190 NEXT ADDR 200 REM MOVEMENT LOOP 210 WHILE 1:VS=VSTICK(0):HS=HSTICK(0) 220 H=H+HS:V=V-VS:PMMOVE 0,H;VS 230 IF NOT STRIG(0):REM SHOOT IT 240 MISSILE 0,V+2,1:JUNK=BUMP(0,0) 250 FOR MH=H TO 255:PMMOVE 4,MH 260 IF BUMP(4,8):REM HIT IT! 270 FOR VOL=15 TO 0 STEP -0.5 280 SOUND 0,32,0,VOL 285 NEXT VOL 290 MH=254:PMMOVE 4,MH 295 JUNK=BUMP(0,0) 300 ENDIF 310 NEXT MH:PMCLR 4 320 ENDIF 350 ENDWHILE 400 REM NEVER GET HERE 410 DATA 153,189,255,189,153
Mike Dunn, Atari Computer Enthusiasts Newsletter, 3662 Vine Maple Drive,Eugene, Oregon 97405.
Table of Contents
Previous Section: Atari Silencer
Next Section: Monkey Wrench