20.02.2013 Views

ZX Computings - OpenLibra

ZX Computings - OpenLibra

ZX Computings - OpenLibra

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}RTIO<br />

3RT W<br />

J Hfl'.f<br />

K E COl<br />

T CORj<br />

MAGEcJ<br />

T"<br />

UEL "<br />

1 THEN<br />

ETRE5<br />

FUEL<br />

1O00<br />

>0) 4<br />

0<br />

ET RE-<br />

FUEL<br />

fQ 'f B<br />

0<br />

METRE 3<br />

FUEL<br />

30 ) 7<br />

S<br />

i METRE<br />

FUEL<br />

.00 ) 7<br />

HROUG I<br />

I ED<br />

i<br />

Paul writes to <strong>ZX</strong> Computing:<br />

"A short while ago I was<br />

writing a 'space war' type of<br />

program with a starry sky, and<br />

moving the space ships by printing<br />

black squares over them<br />

which meant that as the game<br />

progressed all the stars disappeared.<br />

"I was trying to find a way<br />

around this when a friend lent<br />

me his "Programming the<br />

Z80", by Rodnay Zaks. This<br />

helped me to write the following<br />

machine code program:<br />

Id hl,7530h (300001<br />

Id de, (d-file)<br />

inc de<br />

Id be, 02D6 (726)<br />

LDIR<br />

Ret<br />

"This program loads what is<br />

above memory location 30000<br />

into the display, and by changing<br />

over the de and hi registers it<br />

saves the display above<br />

30000. This meant that when I<br />

printed out my sky I used one<br />

routine to save it, then used the<br />

other as a type of CLS, but<br />

recalling the same background<br />

zap<br />

Paul Gausden from<br />

Kingswood brings a little<br />

machine code into play to<br />

put you in the cockpit of<br />

a biplane engaged in a<br />

deadly battle over the<br />

straits of Mallacash.<br />

each time, so now the stars<br />

stayed where they were!<br />

"One of the programs I've<br />

written using this routine is<br />

ZAP. It uses the routines to<br />

save the foreground (the interior<br />

of the cockpit) and recalls<br />

it each time. You are chasing<br />

after an enemy aircraft and you<br />

have to remember the controls<br />

work in reverse.<br />

"To get the GOSUBs in the<br />

REM statements, type THEN<br />

GOSUB and rub out the THEN."<br />

As you can see from the<br />

screen printout, the enemy<br />

plane is the little thing you can<br />

see through the cockpit. It<br />

moves randomly around, and<br />

you must use 5,6,7 and 8 to<br />

move yourself into a position<br />

where the enemy plane will be<br />

on the cross of your sight. As<br />

Paul pointed out, you have to<br />

remember that you are, in<br />

effect, moving backwards,<br />

swinging the view of the enemy<br />

against the sky. This may<br />

sound complicated, but it<br />

becomes very clear once you<br />

RUN the program, and gives a<br />

good impression of a dogfight.<br />

X"<br />

16K Games<br />

1 REM 5K7 GOSUf 7f?RND V B<br />

(SQ5U5 ®T hN<br />

2 REM EERNDIK?" CHR$ GOSLU?<br />

*zN J L'R THE FOLLOWING AS<br />

'IRFOT COMMANDS:<br />

POKE i5516/H7<br />

POKE 1 6 5 1 3 , 9 1<br />

POKE 15539,117<br />

1 REM 5K7 GOSUB ?£RND

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!