Tag Archive: Basic


My first computer, the Mattel Aquarius

When I was barely five years old, I had a one of the best Christmas presents I’ve ever received to this day waiting for me under the tree.  It was the Mattel Aquarius which was a Z80-based computer released in 1983.  My dad had bought it for me at KB Toys.  We never had a computer before that so I didn’t really know anything about computers or video games but I was instantly hooked to it.  It came with four programs since it was sold as some sort of bundle.  The programs were Snafu, Astrosmash, Biorhythms and Advanced Dungeons and Dragons: Treasure of Tarmin.  One of the most interesting features to me however was the built in Microsoft Basic.  This allowed me to enter programs from the manuals that were included with the system.  The manuals were actually very good and I was able to understand and read them even at five years old.  I obviously didn’t fully understand the architecture of the computer back then but I understood enough to enter programs from the book, run them and make minor alterations to the variables to change the behavior of them.

When my dad purchased the system, it was actually on a close-out.  I wasn’t able to purchase any more software or accessories for that system until eBay was founded many years later.  This was a bit limiting but actually kept me focused on just the one system so I learned a lot about it.  At five, I wasn’t a great typist either so it was kind of nice that the Aquarius had a bunch of macros for common commands in basic already etched onto the keyboard.  In addition to that, most programs came with overlays for the keyboard to perform common tasks as well.

Most people look back on this system as a complete failure for Mattel.  Most would also state that the design was not even on par with technology of the late 1970’s.  To be honest, there are several flaws with it.  The first thing was that the keyboard was horrible.  To this day, I still can’t touch type on it since it’s made entirely of crappy rubber calculator keys.  I know at least one of them got modded to use a Macintosh keyboard.  Next, the controllers are just as bad, if not slightly worst than the Intellivision controllers.  You can physically plug in Atari 2600 controllers but they won’t function at all so I was stuck with the disc controllers.  Also, the power cord is hardwired.  This in itself would be fine except the power supply is external so you have this wall wart that is hardwired into the computer.  This caused me much frustration over the years with regard to cable routing.  Finally, there is only an RF output.  I eventually plan to hack my Aquarius by removing the RF modulator and pulling a composite signal out of the unit but I have not taken the time to so yet.  I will blog about it when I do.

Even with all of these flaws, it was actually a fun little system to play with.  It has only 4k of ram, most of which is used up by basic and by the video but it still left a few pages of memory for coding.  When I was five, I didn’t ever run into this limitation but I can see how some of the programs in the manual would push fairly close to the limits of the hardware.

If you aren’t a total purist and want to check out what the Mattel Aquarius was like, you can download Virtual Aquarius for Windows.  This is a fantastic emulator that even includes the roms for all of the aquarius games.  It easily runs on modern hardware at full speed and is a fairly faithful representation.  The only thing missing is the rubber keys and disc controllers but I’m sure you will manage to live without these “features”.

My favorite thing of all on this system was Advanced Dungeons and Dragons: Treasures of Tarmin.  I’ve tried the version on the Intellivision and I have to say it sucks.  Perhaps “sucks” is too harsh but one thing is certain to me, the two games should NOT share the same name because they are nothing alike.  On the Aquarius, you are provided with a keyboard overlay to perform many of the game functions.  This was not a game you could simply pick up and play.  There was a learning curve to it and if you lost the keyboard overlay, you were pretty much screwed.  The graphics are of course chunky by today’s standards but at the time, I thought they were the coolest thing ever.  You crawl through the dungeon in 3D, fight monsters, level up, etc.  Pretty standard, yet primitive, dungeon crawler.  Recently on the emulator, I actually beat this game for the first time ever.  Back in the 80’s I didn’t know if it actually had an end.

A couple of months back, I went back and altered a few programs from the Aquarius manuals.  One of them was the “running man” program.  I also played around with some of the other programs in the manuals too and achieved some interesting effects.  It’s still fun to mess around with basic on an old system like this these days since it’s so simple compared to modern day programming languages and their IDEs.  It’s also easier to learn about computers in general on a system such as this because you potentially can have a full understanding of how all the subsystems work as opposed to modern architectures which have countless subsystems of subsystems that make everything function.  This is one of the reasons I keep this computer around even today.

These systems pop up on eBay a few times a month.  Generally they go for $50-$100 depending on what comes with them.  Not much was released for these systems and they were actively marketed for less than a year so it’s conceivable that you could actually complete a Mattel Aquarius collection.  On top of that, there has been brand new and sealed games sold on eBay for the Aquarius for years.  Night Stalker for instance comes up for sale all the time for $10-$15.  Many retailers and warehouses were apparently left holding the bag on this system so the back stock has slowly been sold off over the last 25 years or so.

Please leave me some comments down below if you have any fond(or not so fond) memories of the Mattel Aquarius you would like to share.

Original Running Man Program for the Mattel Aquarius

I’ve been playing with the first computer I received for Christmas when I was 5 years old.  It is a Mattel Aquarius.  It’s a bit obscure and was not well-received by the general public when it was new but I had many years of enjoyment from it and it really sparked my interest in computers.  Luckily I saved the manuals because there is not much documentation out there for it.  One of the first programs I entered when I was 5 was the Create A “Running Man” program.  I didn’t particularly understand how it worked back in 1983 but looking at it again, the concept is pretty easy.  It clears the screen and prints 2 stacked sprites that look like a man in one position.  Then it clears those sprites and prints 2 alternative stacked sprites one space over, then clears those.  Rinse and repeat.  To prevent the program from running so fast that you can’t see the man running, there is a subroutine called after the man is draw in a particular position that kills a bit of time.  Here is the original program:

10 PRINT CHR$(11)
20 FOR X=0 TO 38 STEP 2
30 A=12328+X+11*40: B=A+40
40 C=A+1: D=C+40
50 POKE A,21: POKE B,22: GOSUB 110
60 POKE A,32: POKE b,32
70 POKE C,23: POKE D,24: GOSUB 110
80 POKE C,32: POKE D,32
90 NEXT X
100 GOTO 20
110 FOR P=1 TO 30: NEXT P: RETURN

Modified Running Man Program for the Mattel Aquarius

I wanted to spice this program up a bit and add some color and variation.  I decided to make the man run at different speeds by randomizing the timer on the subroutine.  I added some color by having the man leave random colored rows of “dots” behind.  I know it’s not terribly innovative but I found the excercise amusing.  Here is the modified program:

10 PRINT CHR$(11)
20 FOR X=0 TO 38 STEP 2
25 IF X=0 THEN COL=INT(15*RND(1))
26 IF X=0 THEN SPD=INT(200*RND(1)+20)
30 A=12328+X+11*40: B=A+40
40 C=A+1: D=C+40
45 POKE B+1024,COL
50 POKE A,21: POKE B,22: GOSUB 110
60 POKE A,32: POKE b,32
70 POKE C,23: POKE D,24: GOSUB 110
80 POKE C,32: POKE D,32
90 NEXT X
100 GOTO 20
110 FOR P=1 TO SPD: NEXT P: RETURN

I’ve tested it on my real hardware and Virtual Aquarius now so it should work for you as shown.  If you have your own fun variations to this program or other fond memories of this computer, please post a comment down below.

Hello, world is the most basic of all test programs.  It’s one of the first steps to determine if you have your development environment set up correctly and is also a good first program to learn in any language because it will give you a good idea of the bare minimum requirements to build a program in a given language.

BASIC

Let’s start with Hello, World in basic since that was the first programming language I ever encountered.  The code is very simple:

10 PRINT “Hello, World”

RUN

10 is a line number which is a requirement of old basic compilers.  Generally the lines are numbered  10, 20, 30, etc although they don’t have to be.  Part of the reason for this is so you can later insert other line numbers into your code without renumbering all of your lines of code.  Newer BASIC implementations have sub-routines and other features have have allowed them to ditch the line numbers.  The program is executed from top to bottom so everything in basic has to be in order.  The command RUN at the bottom runs the program and will display your text.  It is not actually part of the program.

Ruby

In Ruby, there are two easy ways to do a hello world program.  I’ll assume you are using a Unix-based machine to try this example.  You’ll need to create a text file called hello.rb with a text editor.  The first way is:

puts ‘Hello, World’

Save your file and type ruby hello.rb at the command prompt.  If all went well, it should print Hello, World and then give you back your command prompt.  I’m assuming that you have installed ruby and it’s in your path.  On a Debian system, it’s easy to install ruby if it’s not already there.  Use a command such as sudo apt-get install ruby.  The other ruby hello world example is:

print(“Hello, World\n”)

C

Hello, World in C is far more complex than any of the other examples.  This is because C is highly structured and not very forgiving.  It also doesn’t have the printf function in the core language so the standard input and output library must be included.  I will also assume you are using a Unix environment for this example.  If you try to run this in a dos/windows environment it will probably fail.  Here is the hello world code in C:

#include <stdio.h>

int main(int argc, char *argv[])
{
printf(“Hello World\n”);
return 0;
}

To run it, you’ll need to put the code in a text file called hello.c.  Then type in gcc hello.c at the command prompt.  This should generate a file called a.out.  At the command prompt, type ./a.out to run the program.  Different compilers and environments may give different results.

Bash

The last example I’ll give is for bash scripting.  Some people would argue that bash is not a programming language but nevertheless it’s a very powerful way to accomplish tasks with other programs and it’s a good way to automate repetitive tasks.  Here is hello world in bash:

#!/bin/sh

echo “Hello, World”

To run this you could simply type the bottom line at the command prompt.  Instead, save it to a file called hello.sh.  Now before you run it, you’ll need to set the executable bit.  Type chmod 755 hello.sh at the command prompt.  Now you can type ./hello.sh to execute the script.

Powered by WordPress. Theme: Motion by 85ideas.