Timeblasters

Products: Timeblasters
Date: 1983
Type: Cassette
Platform(s): TS 1000
Tags: Arcade, Game

Timeblasters is a shoot-em-up game in which the player destroys alien spacecraft and space stations across multiple skill levels, from Novice to Master. The program uses machine code via USR calls at lines 30 and 40 (targeting addresses 18548 and 26218), which handle the core gameplay engine. A distinctive mechanic ties the game’s speed to player performance: missing shots or letting enemies pass accelerates time, while destroying space stations dead-center slows it down. The loader manipulates the system with POKE 16389,84 before saving, and uses a polling loop with INKEY$ to detect a specific keypress before proceeding to the save/run sequence. Controls use E (up), F (down), and 7 (fire), with scoring milestones rewarding the player with extra ships and a time reduction.


Program Analysis

Program Structure

The listing as shown is a self-contained loader/bootstrap. Line 1 is an unusually large REM block that contains the entire game program encoded as tokenized BASIC — a common technique for distributing ZX81/TS1000 software where the game code is embedded in the REM workspace and executed via USR calls into machine code. Lines 2–9 contain visible metadata REMs. The short executable section (lines 10–160) is the bootstrap loader that initializes memory, triggers the embedded machine code, and saves the game to tape.

The REM Line Encoding

Line 1’s REM contains what appears to be nearly the entire game: it includes BASIC keywords, control structures, display output, game logic, and a help/instruction sequence all rendered as token sequences. This is a well-known trick where the REM statement acts as a data/code container. The machine code installed by the USR calls in lines 30–40 can then interpret or jump into these stored tokens directly, bypassing the BASIC interpreter’s normal entry point restrictions.

Bootstrap Loader (Lines 10–160)

LineAction
10SLOW — sets display to slow (SLOW) mode
20RAND — seeds the random number generator
30LET L=USR 18548 — calls machine code at address 18548
40LET L=USR 26218 — calls machine code at address 26218
50–80Polling loop waiting for key "1" to be pressed
90–100Confirmation pause; if "1" not held, jumps to USR 0 (warm reset)
110–140Pause, CLS, POKE system variable, CLEAR
150SAVE "TIMEBLASTERS" — saves the game to tape
160RUN — restarts execution

Machine Code Usage

Two USR calls are made in sequence. Address 18548 is within the upper RAM region typically used for machine code routines on a 16K or 48K expanded machine. Address 26218 is similarly in RAM. These routines almost certainly install the game engine — copying code from the REM block into RAM, setting up interrupt handlers or display routines, and preparing the game data structures. The result of each call is discarded (assigned to L only to satisfy BASIC syntax).

POKE 16389

POKE 16389,84 at line 130 writes to the system variable RAMTOP high byte (system variable area starts at 16384; offset 5 is RAMTOP). Setting this value to 84 places RAMTOP at 84×256 = 21504, reserving the upper memory region for machine code and preventing BASIC’s memory manager from overwriting the installed routines during the subsequent CLEAR at line 140.

Key Detection Idiom

Lines 50–80 implement a finite polling loop rather than an infinite PAUSE 0/INKEY$ wait. The loop runs up to 40 iterations checking for key "1"; if not detected, it resets to line 40 and tries again, creating an indefinite wait that still returns through the loop counter. Lines 90–100 add a double-confirmation: after the initial detection there is a PAUSE 100, then a re-check; failure sends the program to RAND USR 0, a hard reset.

Game Mechanics (from REM block)

The embedded game code within the REM block reveals the following design elements:

  • Six difficulty levels: Master, Admiral, Captain, Warrior, Cadet, Novice (selected via keys 1–6)
  • Controls: E = up, F = down, 7 = fire, BREAK = reset
  • Five player ships; ships lost on crash or being hit
  • Time acceleration as a penalty for misses or letting enemies past
  • Destroying space stations dead-center slows time
  • Every 100 kills awards five extra ships and a minor time reduction
  • Score and ship count tracked via variables named SCORE and SHIPS

Notable Techniques

  • Entire game stored in a single REM statement as tokenized BASIC and/or binary data, a space-efficient distribution method
  • RAND USR 0 used as a deliberate warm-reset/abort path
  • RAMTOP manipulation via direct POKE before CLEAR to protect machine code from garbage collection
  • The save sequence at line 150 saves the whole program (including the REM-embedded game) to tape as "TIMEBLASTERS"
  • Instructions and credits are embedded as string literals within the REM block’s token stream, displayed by the machine code engine rather than by BASIC PRINT statements in the main program

Potential Anomalies

Line 160 executes RUN after the SAVE, which would restart the loader from line 10. This is intentional: after saving, the loader cycles back so the operator can load and run the newly saved tape. The RAND USR 0 at line 100 acts as a safety exit if the confirmation keypress is not maintained, preventing accidental saves or runs.

Content

Appears On

Related Products

Arcade quality graphics space battle. Almost 2K of machine code give unbelievable realism and speed. Six levels of difficulty. 16K.

Related Articles

Related Content

Image Gallery

Source Code

   1 REM "TIMEBLASTERS"############################LN ##LN [V]▝# RETURN[X]COS  RETURN#C/ RETURN TO C▝/ LOAD LN  THEN#LN ##LN [0]#LN ##LN ▒#LN ##LN [E]# LN [V]▝# RETURN CLEAR4▛Y(M##/Q RETURN CLS4▛Y4M##/F RETURN RUN 4▛YKM##/4 RETURN LOAD 4▛YRNDM##/+# RETURN RUN 4▛Y#M##/\,, RETURN LOAD 4""Y#M##LN ##/[£]LN E\~~LN  SLOW##        █[T][I][M][E][B][L][A][S][T][E][R][S]█#================================##THIS IS A WAR:##TO SURVIVE, YOU MUST DESTROY AS#MANY ALIEN SPACECRAFT AND SPACE#STATIONS AS POSSIBLE.##THE ALIENS POSSESS A TECHNOLOGY#WHICH ENABLES THEM TO CONTROL#TIME.  WHENEVER YOU FIRE AND#MISS, OR LET AN ENEMY GET PAST,#THEN TIME WILL ACCELERATE.##YOU CAN SLOW TIME DOWN BY#EXPLODING THE ALIEN SPACE#STATIONS, BUT YOU MUST HIT THEM#DEAD CENTER TO DO THIS.##(TOUCH ANY KEY)# STOPTAN  LN E\~~LN  SLOW##YOU HAVE FIVE SHIPS IN YOUR#FLEET, BUT YOU WILL LOSE ONE#IF YOU CRASH OR GET BLASTED.##IF YOU DESTROY 100 ALIEN SHIPS#AND STATIONS YOU WILL GET FIVE#EXTRA SHIPS AND TIME WILL SLOW#DOWN A BIT.####GOOD LUCK.####EARTH IS DEPENDING ON YOU......#####(TOUCH ANY KEY)# STOPTAN LN E\~~LN  SLOW##================================#CHOOSE YOUR LEVEL OF SKILL:#================================####       LEVEL      KEY#================================##      MASTER       1#      ADMIRAL      2#      CAPTAIN      3#      WARRIOR      4#      CADET        5#      NOVICE       6##================================####(TOUCH THE KEY YOU WANT)# STOPTAN LN E\~~LN  SLOW##================================#USE THESE KEYS TO PLAY:#================================####       LEVEL      KEY#================================##       UP         E#       DOWN       F#       FIRE       7##       RESET      BREAK##================================##PRESS ANY KEY TO CONTINUE#AFTER PAUSES.##(TOUCH ANY KEY)# STOPTAN     LN E\~~LN  SLOW###================================##    █[T]█[I]█[M]█[E]█[B]█[L]█[A]█[S]█[T]█[E]█[R]█[S]█##================================####     COPYRIGHT 1982#     DAN TANDBERG, M.D.#     CALLIOPE SOFTWARE#     ALBUQ., NM####     INSTRUCTIONS?##     Y IF YES#     N IF NO## STOPTAN LN E\~~▞4VAL LN ##LN  NEXT #AT ( PLOT  [J]M(#YKM##LEN 4M##Y6M;#5  6##Y M[▒]#Y3M CONT #LN ##E£RND7777 FAST)#▝;6## LPRINT )5 ;6##;( CLEAR6##6##LN [=]#LN ##LN ,#[J]MCODE # LN [V]▝Y CLEAR[W]COS LN ##LN ##LN ,#LN ##LN  NEXT #LN [K]#LN ##U;# RETURN0 PRINT ATN ## LET COS LN COS #LN  #LN [-]#/EXP           E##6##7776##LN [X]#Y▌LN [+]#Y[*]LN [+]#Y[=]LN [+]#Y[-]LN [+]#Y█LN [+]#LN SQR #LN ##U## RETURN▀""Y▛M CONT #TAN         5▙RND)RND#▘[K]$ GOSUB [K]TAN           Y▘M##TAN Y M##TAN UMRNDACS #""LN ▌#TAN      E## GOSUB ###LEN   GOSUB #COS E##)5 LEN   GOSUB #6##TAN E## GOSUB ###LEN   GOSUB #COS E##)5 ;6##TAN  E##▞,#7( UNPLOT   ▞;VAL LEN  ( UNPLOT AT ( SAVE TAN LN 4## NEW3 RETURN▛""LN <#U(# RETURN ""   LN ##E£RND)1 ;)5 ;( CLEAR6##Q[<]7Q▒7Q[C]Y▘M[▒]#TAN ██[.]███████████████LN 4#ACS #COS :3ACS #4▛LN  PRINT ▒Y[.]NOT TAN ACS #""LN  PRINT ▒Y[*]NOT TAN ▞▀#7( UNPLOT TAN GAME OVEREMRND##EORNDDD;DDD;6MRND##ACS [S]ACS [K]ACS [C]Y=[S] IF 4#TAN    E£RND7▞+VAL ##7▘3  GOSUB [K]FQ█77AT ( LOAD TAN     ▘ ## # #[9]#" ▀#I [C]#▞# #  GOSUB ###5*#▘\,,  GOSUB [K]LN ##TAN     ) LPRINT #5 REM #▘\,,  GOSUB [K]TAN    U[▒]# RETURN COS E##F# RETURN#COS 6##TAN     E### RETURN#C▀F/ SAVE 7TAN LN [K]#▘3 ) STEP #LN [K]# GOSUB [K]LN ##TAN  LN [K]###▘3 5 STEP # GOSUB [K]TAN   ███[=][0][>]████[X]████████████████████ U##LEN ▖ACS JM▒#M[5]#TAN             E##)5 LEN   GOSUB ##M LPRINT #7#M LLIST #7#M STOP#;#M NEW#F#M FAST#F#M SLOW#;#M SCROLL#7#M CONT #7#M DIM #TAN    E##)5 LEN   GOSUB #U LPRINT ##7U LLIST ##7U STOP##;U NEW##FU FAST##FU SLOW##;U SCROLL##7U CONT ##7U DIM ##E##6##TAN E##)5 LEN   GOSUB #LN (#)2 ;LN (#;LN (#TAN       ▞EVAL ( RETURNAT ( IF [J]M[▒]#TAN    6##▞▀VAL E##Y LN (#LN [K]#E##Y[*]LN (#LN [K]#AT ( NEW Y[X]LN [)]#LN [K]#Y[*]LN [)]#LN [K]#Y[.]LN [)]#LN [K]#Y█E##LN (#LN [K]#Y█LN [)]#TAN     SCORE=SHIPS=5 LN SIN #E##)PI ;▞▞)$#,#7<( IF ▞+:\,,LN  PRINT ▒E##LN [5]\~~TAN       E£RND7▞-)5 # RETURN[<] FASTATN ## LPRINT ;( PRINT TAN Y<#7Y=#7Y<#LN  #TAN   TAN      COPYLN [V]▝#M##ACS #ATN ##U##ACS #ATN ##LN [A]#LN ##U##ACS #ATN  LIST #TAN  U;#XM;#E£RND)ACS ▝;##5<#▘▛  GOSUB [K]LN [*]#TAN      LN ##E##)5 ;( CLEAR6##6##TAN U(# RETURN COS XM(#TAN ▀[.]▀[.][.]█ COPY  U[▒]# RETURN COS  LN 4## NEW3 RETURN "" LN [$]#)PEEK #E##F# RETURN#C▖,#/ PLOT <, RETURN COPYC: ▞;VAL LEN  ( UNPLOT AT ( SAVE / STEP  LN SQR #E## GOSUB ###<<<<LEN   GOSUB # SAVE  E##), ; GOSUB ###LEN   GOSUB # SAVE  [J]M[▒]#E##LN ""#LN ["]#LN [=]#TAN       LN [,]#LN ##LN [F]#LN >=#TAN    ▞[3]VAL [J]M[▒]#( IF AT ( PLOT  LN [V]▝Y COPY[X]C SAVE TAN     LN [-]#LN 4#Y▝[S] PAUSE ##Y)[S] IF ##TAN E##6##LN [X]#TAN U;# RETURN0 PRINT CODE ## LET COS LN [P]#TAN           U## RETURN COS U###VAL  ( CLEARAT ( RAND TAN   "  E##76##UCODE #WMCODE # RETURN#""U;#LEN ▌M;#[J]MCODE # E£RND)ACS ▝;##5<#▘▛  GOSUB [K]U## RETURN# LIST LEN 4M##TAN    U## RETURN▝COS XM##TAN    LN ### RETURN\,,""U## NEW?LEN ▀#E£RND)2 ;)5 ;( CLEARY▛#77Y▜#)4 ;Y[X]#;Y▙#77Y▟#Y▀M(#TAN    E##F▞;# RETURN▛CR RETURN▙CN RETURN[<]C< RETURN▒C? RETURN[C]C" RETURN[X]C:7( SLOWLN ##TAN LN ""#LN .##U## RETURN# PAUSE ▐#LEN ▞M##FLN ""#LN .#TAN LN ""#TAN EMRND7 GOSUB ###;6MRNDTAN    E##▞▀# NEW COPY REM ASN #ACS #4+ACS #C)7( LOAD  E##Q[=]7Q[0]7Q[>]TAN   FASTE##LN [X]# LPRINT LN ""#E##LN ""#LN ["]#LN [=]#TAN   AT \~~▀VAL  RETURN STOPCOS LN ▒▒/ POKE   ............................................
   2 REM   █["][T][I][M][E][B][L][A][S][T][E][R][S]["]█
   3 REM   COPYRIGHT 1982
   4 REM   DAN TANDBERG,M.D.
   5 REM   CALLIOPE SOFTWARE
   6 REM   ALBUQUERQUE, NM
   7 REM  ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   8 REM  "THOU SHALT NOT STEAL"
   9 REM   EXODUS 20:15
  10 SLOW
  20 RAND 
  30 LET L=USR 18548
  40 LET L=USR 26218
  50 FOR L=1 TO 40
  60 IF INKEY$ ="1" THEN GOTO 90
  70 NEXT L
  80 GOTO 40
  90 PAUSE 100
 100 IF INKEY$ <>"1" THEN RAND USR 0
 110 PAUSE 800
 120 CLS
 130 POKE 16389,84
 140 CLEAR
 150 SAVE "TIMEBLASTER[S]"
 160 RUN 

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

People

No people associated with this content.

Scroll to Top