PROGRAM PITSTOP
from Your Sinclair #27 (March 1988)

Ta daah! Yes, the man with the POKEs, David McCandless, is back, back,
back to bring you the latest in byte-sized entertainment.


Welcome to Program Pitstop with the new improved rather exotic flavour.
Much, much more to titillate your tastebuds than Phil Snout ever gave
you. Unfortunately, probably because it's my first column, we have no
Star Tips this month. All those programmers out there were too busy
recovering from the New Year celebrations to send me anything. Anyway,
luckily a few megabrained readers sent me in some rather juicy tips of
their own. Round of applause pur-lease! First for Peter Dackombe who
sent in a useful interrupt-driven clock, second for Philip Locke who's
supplied us with a plethora of ways to print a screen. Not forgetting
Michael Wilcox and his stretchy screen routine. Gosh!

Next month we'll have some really juicy Star Tips for you, so mail all
those super routines I know you've got lurking in the back of your
drawers to me, David McCandless at Program Pitstop, 14 Rathbone Place,
London W1P 1DE. And while you're at it send us a picture of yourself
along with your snazzy routine. Any picture will do and that goes for
the routine too - just make sure it's not too long. Other than that it
can be anything from a bubble sort to a full blow 3D Screen Creator. The
sooner the better.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


TICK-TOCK CLOCK
by Peter Dackombe
from Your Sinclair #27 (March 1988)
[files TICKTOCK.*]

Ever lost track of time while slaving over a hot Speccy, typing in
unfolding pages of endless hex? Missed a very important rendezvous with
your girlfriend because you have no idea of the time when you were
programming? If so then this program, from ol' Peter Dackombe, is for
you. Type it in, RUN it, and an interrupt driven clock will appear in
the top right-hand corner of the screen that'll give you the current
time to the nearest second. Gosh! And what's more you can still type in
hex, Basic or whatever with the clock running at the same time!

Please Interrupt

Interrupts are specialised instructions that, when used correctly, can
enable you to run two programs simultaneously. What you see is actually
an illusion; the computer is just jumping between the two routines every
50th of a second, so it only seems like the two are running together.
Now you know.

Method

Nothing could be simpler. All you need to do is type in the hex loader
(or load it in if you've got it on tape) and use it to enter the machine
code hex. Then, to get the clock ticking, just:

POKE 64026, seconds
POKE 64027, minutes
POKE 64028, hours (1-12)
POKE 64029, 0 if AM or 1 if PM

Done that? Now type in RANDOMIZE USR 64001 to start the clock. Then,
hours later, when it comes to beddy-byes or rendezvous time just type in
RANDOMIZE USR 64008 to stop time.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


Screen Effects - Philip Lock (Your Sinclair-March 88-Page 77)
[files SFX1.*]

Yawn! Have you ever realised how the way a screen is printed is so totally
boring? I mean one minute the screen's blank, then the screen's there -
sooooo boring. But wait, here is Philip Lock to the rescue with a collec-
tion of no less than 14 ways to recall a screen from memory. They include
fades, shutters, slides and colour doors. And they are very effective I
can tell you. What are you waiting for? Get typing!

METHOD
Easy as pie: all you have to do is type in the hex dump using the hex loader
(see TICK-TOCK CLOCK). Done that? Good, now save the whole lot by typing
SAVE "effects"CODE 60000,696. Now type in the little demo proggie and run
it to see an effective compendium of effects. Go for it!
 If you want to use the routines independently just load your screen into
the memory by typing LOAD ""CODE 53000, (or alternatively load the screen 
as per normal, then RANDOMIZE USR 60016 to store in memory) then consult
the table below and RANDOMIZE USR address for whatever address the routine
resides at.
 If you really like a particular routine and want to use it in your own
masterpieces, just save the routine by typing: SAVE "name"CODE address,
lenght, substituting the words for values from the table:

A LITTLE ROUTINE
Routine Name:   Address:        Length:

PRINT           60000           12
STORE           60016           13
FADE            60025           53
SHUTTER         60078           51
SLIDE-DOWN      60129           75
SLIDE-UP        60204           70
SLIDE-LEFT      60274           67
SLIDE-RIGHT     60341           65
ATTR-DOWN       60406           24
ATTR-UP         60430           35
ATTR-LEFT       60465           52
ATTR-RIGHT      60517           47
ATTR-IN         60564           55
ATTR-OUT        60619           75


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


FLAPPETY FLAP
by Michael Wilcox

Ever wanted to recreate the stretchy pulsating (yes I know ... oo-er)
effect in games such as Max Headroom and Glider Rider? Well now,
courtesy of Michael Wilcox's programming skills, you can involve just
such a sproingy flapping (Again? Okay ... oo-er) effect in your own
programs. And what's more it's a mere 180 bytes.


Method
Simply type in the hex dump using the ol' hex loader and once you've
finished save the code by typing: SAVE "flap" CODE 27000,180. Then
type in the DEMO PROGRAM and RUN it to see the flappy routine.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =


ARCADE ANTICS
by David McCandless

Now it's my turn (and anyone who suggests I can't program, better
watch their kneecaps!). Over the next few months I'll be printing some
routines of my own that'll add that certain polished finish to your
own arcade games. This month it's a simple bar display routine, that
you can use to show the amount of fuel or ammo instead of tedious
numbers.

Method
Stone me. To use this program is a physical manifestation of easiness
(and no, I don't know what that means either!). Just type in the
seventeen lines of hex, save the code, then POKE these variables:

POKE 40131,length of bar (0-255)
[That's wrong, as a value of zero causes the program to crash - although
calling the routine just to display nothing would be a bit pointless 
anyway. JimG]
POKE 40129,screen-256*INT (screen/256)
POKE 40130,INT (screen/256)

NB: Screen refers to the position of the bar on screen, it must be in
the range 16384-22527. [That's also wrong. The last valid address is
20735, as that's the top byte of the right-hand character in the
bottom row of the lower screen. The maximum "screen" value = 20735-INT
((len-1)/8). JimG] POKE 39991 to 39998 with the eight bytes of your
pattern. It can be a UDG or anything. Then, once you've done that,
just type RANDOMIZE USR 40000 to see your bar.

Hex Dump
This puts the Bar Display program in hex. Type it in and use SAVE
"bar" CODE 40000,136 to plonk it on tape.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Well, that's it for this month. But never fear - I shall return to
your screens next month with loads more wild and wacky routines.
Meanwhile, get programming and send your routines in to Program
Pitstop, YS, 14 Rathbone Place, London W1P 1DE. And remember, we'll
even pay for the very special routines.
