Our family friends the Hansels were the first to get a videogame system, the Atari VCS. I remember playing Combat, Breakout, and later Space Invaders. My dad was jealous, but he ended up getting us the Bally Astrocade. This turned out to be a great system, and its BASIC was far better than the Atari’s (the Atari BASIC Programming cartridge limited programs to 64 characters!).
The Wikipedia article on the Astrocade didn’t have many details about its BASIC, so I added a section on the language. To that point, I’d programmed Level I BASIC, Level II BASIC, Integer BASIC at the library, and Sinclair BASIC at a friend’s. Even though all those other systems used keyboards, and Astro BASIC required an overlay on top of the Astrocade’s calculator keypad, it was the most functional system for writing games, because it had built in support for joysticks and sound.
How functional were the graphics? The very first version of Artillery Duel, an eventual cartridge, was written in Astro BASIC. Definitely my favorite game in the language. [Here’s a video playthrough.]
I didn’t realize it at the time, but Astro BASIC, like Level I BASIC, was adapted from Li Chen Wang’s Palo Alto Tiny BASIC.
Programs were entered via the calculator keypad, with a plastic overlay displaying letters, symbols, and BASIC keywords. These were selected through a set of 4 colored shift keys. For example; typing “WORD”(gold) shift then the “+” key would result in
A simple line editor was supported. After typing the line number corresponding to an existing program, each press of the PAUSE key would load the next character from memory.
Astro BASIC supported the following keywords–
- Tape Commands:
JX()(specified joystick’s horizontal position),
JY()(joystick vertical position),
PX(X,Y)(pixel on or off),
- Built-in variables
- (read only):
RM(remainder of last division),
XY(last LINE position)
- (write only):
TV=(display ASCII character)
- (read only):
- Math: + – × ÷
- Relational operators: < > = # [not equal] [the language did not support: <= => <>]
- Logical operators: × [AND] + [OR]
. at the start of the line was equivalent to
REM in other BASIC implementations. Certain commands were handled by the keypad instead of by keywords: the RESET button was equivalent to
NEW in other interpreters.
The language supported 26 integer variables
Z, and two pre-defined arrays,
@() – which was stored starting after the program, ascending – and
*() – which was stored from the top of memory, descending. The language lacked a
DIM statement for dimensioning the arrays, the size of which was determined by available memory (
SZ) not used by the program listing (2 bytes per item). Ports were accessed via the array
&(), and memory was accessed via the array
%(), rather than using PEEK and POKE. While the language lacked strings,
KP would provide the ASCII value of a key press, which could be output to
TV, meaning that characters could be read in from the keyboard, stored in an array, and then output.
The character display was 11 lines of 26 characters across. The resolution for the graphic commands is 88×160, with X ranging from -80 to 79 and Y ranging from -44 to 43.
Music could be produced in four ways:
MUvariable converted numbers into notes.
- Ports 16 through 23 accessed a music synthesizer.
- The sound-synthesizer variables
VA(Voice A volume),
VB(Voice B volume),
VC(Voice C volume),
VR(VibRato). (Added to Astro BASIC but not in Bally BASIC.)
The following sample program from the manual demonstrates the joystick input and graphics functions. “Try your skill… The first player’s knob moves the phaser left or right and the trigger shoots… Player two controls the target while player one shoots.”
1 .PHASER PHUN 2 .BY DICK AINSWORTH 10 X=RND(60)-31 20 Y=RND(20) 30 CLEAR 40 X=X+JX(2)×3 50 Y=Y+JY(2)×3 60 BOX X,Y,4,4,43 70 K=KN(1)÷2 80 BOX K,-40,3,8,1 90 IF TR(1)=0GOTO 30 100 N=1 110 IF K>X-3IF K<X+3N=15 120 FOR A=1TO N 130 BOX K,0,1,80,3 140 MU="4" 150 BC=A×8 160 NEXT A 170 FC=7 180 BC=8 190 GOTO 10