SHORTCUTS
ZX Computing, August 1986

If you've got an amazing chunk of code or some dazzling short
routines lying around, why not send them in to Short Cuts -
and earn yourself #10!


- - - - - - - - - - 
FADE OUT

M. Waters of Slough sent us the first program, a great way of clearing
the screen in games. It really gives that professional touch to your
programs.

It works by removing pixels to give a dissolve effect and uses a 50
byte machine code routine. As it is printed here, it is loaded to
address 30000 so that both 16K and 48K owners can use it. To relocate
it higher in memory and make it more practical for 48K users just
change the "30000 TO 30049" to the address of your choice (i.e. 60000
to 60049) and call it with RANDOMIZE USR your address.


- - - - - - - - - - 
SCRAMBLER

One for the newcomers sent in by Niclas Carlenius of Sweden is a
version of the ever popular scrolling game. Notice the use of USR 3582
to scroll the screen one line.

To adapt the program to your own taste should not be that difficult a
task for even the least experienced, and to adjust the speed of the
game vary the number 20 in line 150 [There's no such number
(presumably a PAUSE) anywhere in the listing. JimG] and you can adjust
the road width by modifying the number of spaces in line 90.

The aim of the game is to drive as long as possible along the road as
it scrolls towards you using keys 5 and 8 to move left and right.
Niclas tells us his highest distance/score is 1900 - get driving!


- - - - - - - - - - 
HACKER BASHER

One of our most frequent requests is for ways of making your programs
hacker proof (personally I feel pleased that anybody would want to see
how I wrote a program). I.J. Rogers has sent us the method he uses.

One method is to make a program unmergeable and this can be done by
POKING the line length of the first line in the program with 255. When
the program is saved and someone tries to MERGE it the computer thinks
it hasn't enough memory and refuses to accept it!

Due to the way in which Sinclair BASIC is stored you have to add a
little more to your program than a simple POKE, but this isn't a lot
and it is very easy. The secret is to include the following lines:

   1 POKE 23758,0: GO TO 5
   5 main program starts here
9999 POKE 23758,255: SAVE "PROGRAM" LINE 1

SAVE your program by using the instruction GO TO 9999 and verify it
with VERIFY "" as per usual. Now NEW your computer and try to MERGE
the program. Mind you it is not much use on its own as you can still
load it and BREAK the program to list it. To make it completely
foolproof you will have to use one of the POKEs which cause a crash if
anyone tries to break it as the first line of your program. i.e.

   5 POKE 65364,0: POKE 65365,0

[This is assuming that RAMTOP is at the default location of 65367.  JimG]

And, just to make life really difficult, you may have to use a bit of
extra code to find the start of the BASIC line if you have a
microdrive or disk unit attached;
i.e. POKE (PEEK 23635+256*PEEK 23636)+3, 255 or 0
