Guardian

Products: Guardian
Date: 1983
Type: Program
Platform(s): TS 2068
Tags: Arcade

Enemy ships have been spotted off your shore, and your mission is to blow them out of the water. From the control panel of the Guardian, an Ohio-class heavy cruiser, you move a missile sight over the enemy ships and fire conventional or nuclear missiles; nuclear missiles have a wider margin but close counts with both. A countdown timer limits the game, and each hit adds time. The enemy’s laser grid can set your ship on fire, and you must press W to water the fire until it is out. Shooting down the enemy smart missile scores a 100-point bonus and resets the clock to 100. If you run out of missiles while time remains, you can buy more: conventional rounds cost one time unit each and nuclear rounds five.

The keys are Q, A, O and P to move the sight, I to fire, C and N to select the missile type, W to put out fires, and S and R to stop and resume; a joystick can be used instead. The game ends with your score, the number of ships sunk and a high score entry for your initials. The title screen reads “© TIMEX 1983”.

Program Analysis

Structure

  • guard: loader (lines 10–50) that loads the screen, the machine code and the main program.
  • ship$: loading screen, 6,912 bytes at 16384.
  • to: 22,000 bytes of machine code at 40000.
  • arms: the BASIC game, auto-running at line 4999.

The BASIC Program

  • Lines 5000–5162: the title, drawn letter by letter with PLOT and DRAW from DATA lists with a BEEP per stroke, and the high score.
  • Lines 6000–6320: sound effects using SOUND to program the sound chip.
  • Lines 7000–7060: buying more ammunition.
  • Lines 7200–7232: game over, score and high score.
  • Lines 7500–7699: the rules, shown over the real control panel drawn by the machine code.
  • Lines 8005–8099: six user-defined graphics set from BIN data.
  • Lines 9000–9098: the main loop, which calls machine code routines at 47000, 53730, 55800, 56080, 56200, 57040, 58220, 58400 and 58700 and passes values through a block of variables at 50016–50096 (ammunition counts, time left, score, ships sunk).

Notable Techniques

  • The game is a hybrid: BASIC handles the menus, rules and scoring, while the machine code draws the control panel and runs the action. Time and score are kept as two-byte values that BASIC reads with PEEK 50070+256*PEEK 50071.
  • Line 4999 sets ON ERR GO TO 9900; the handler at 9900–9930 pauses, resets the error trap with ON ERR RESET and continues with ON ERR CONTINUE.
  • The keyboard repeat delay and rate (system variables 23561 and 23562) are shortened during play and restored afterwards.

Potential Issues

  • The rules screens at lines 7570 and 7630 contain COPY, which sends the screen to the printer each time the rules are shown.
  • Several GO SUB and GO TO targets (8000, 6000, 6100, 6200, 7000, 7200, 7500, 7698) do not exist; execution falls through to the next line, which works but appears to be a leftover of renumbering.
  • Line 9096 is a disabled REM LET c1=USR 58850.

Related Products

Enemy ships have been spotted off your shore. Your mission is to blow them out of the water.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.