SATURN LANDER
by Garry Owen
from Your Computer, May 1983

Landing on the surface of the planet Saturn from an
equatorial orbit is not an easy number. Garry
Owen's 16K Spectrum program will help you
run rings round space pilots who boast
about working in the asteroid belt.


You are in command of the first manned
mission to Saturn. Your object is to land on
the planet's surface but to get there you have
to navigate through the rocks which make up
Saturn's rings whilst compensating for the
strong gravity.

	The program, for a 16K Spectrum, is
mainly BASIC but four machine-code routines
are used. The routine at 32000-32024 scrolls
one line right to left by one pixel and the
routine at 32100-32139 scrolls one line left to
right by one pixel. Each of these needs the
address of the first byte of the top row of the
line to be scrolled supplied to it in the HL
register to work.

	The routine at 32200-32242 calls the two
scroll routines and provides the correct
addresses. This moves the rocks. The routine
at 32300-32318 positions the landscape so that
the landing pad is a random number of pixels
from the edge of the screen.

	The data for the machine-code routines is
held in DATA statements, in hexadecimal, in
lines 9610-9640 and POKEd into memory by
lines 9500-9590 after RAMTOP has been
lowered to 31999 - lines 9500 and 9600.

	The data for the user-defined graphics -
lines 9020-9070 - is POKEd into place by lines
9000 and 9010. Note that the capital letters in
lines 40 and 50 are the graphics characters on
those keys.

	Type in the program as shown and before
attempting to RUN it, SAVE it so that it auto-
runs from line 8999 on LOADing, that is:
	SAVE "SATURN" LINE 8999
This ensures that all the data is set up before
the program is RUN. VERIFY it, NEW the
program and reload. You should get the
message:
	PLEASE WAIT WHILE DATA IS POKED
The program is now ready to run.

The controls are:
1 to accelerate to the left
2 to accelerate to the right
0 to accelerate upwards

	Note that if you are already moving in the
opposite direction to that which you want to
go, you will slow down first: Watch the
velocity readings at the bottom of the screen.

	The remaining program structure is as
follows:
  10-11    draw lander
  20-35    draw landscape and move it
  40-55    prints rocks on screen
  60-62    initialise variables
  64-200   main program
1000-1060  crash routine
2000-2030  successful landing routine

	The variables used are SX and SY which
give the co-ordinates of the lander, and HV
and VV - horizontal and vertical velocities
