* -*- outline -*-

   ZX81 Tetris/TetrisHR/Tetris1k - public domain by Russell Marks, 1996

	   Text-mode and hi-res tetris clones for the ZX81.


* License

Tetris, TetrisHR, and Tetris1k are public domain, you can do what you
want with them. I would appreciate it if you could copy this text file
whenever you copy the games, though.


* About Tetris and TetrisHR

ZX81 Tetris, TetrisHR and Tetris1k are tetris clones. `tetris' should
run on any emulator. `tetrishr' uses a pseudo-high-res mode and will,
as far as I know, only run on Xtender and my Z81 emulator. Needless to
say, they both run ok on a real ZX81. :-)

`tetris1k' is a version which runs on a 1k ZX81. It's mostly a
complete implementation, but there are some problems with it, so be
sure to read the "About Tetris1k" section before trying to load/run
it.


* Playing ZX81 Tetris

It's tetris. Surely you've played tetris!?

Ok, the basics. Blocks fall from the top of the screen. You have to
fit them together to make solid horizontal lines, as a horizontal line
of blocks disappears to make room for more blocks. And why is this the
case? Well, if the pile of blocks reaches the top of the screen, it's
game over. So it quickly gets important to fit the shapes together
well, and not leave any gaps.

You can rotate the blocks with `s', move them left or right with `k'
and `l', and `drop' them with `d'.

ZX81 Tetris does not (yet) speed up. It starts pretty fast and stays
that way. This is IMHO a better test of the player (persistence and
all that). Yes, it's a feature, not a bug. Really. :-)


* The hi-res one's graphics are corrupted!

Well, the hi-res hack possible on the ZX81 isn't really hi-res, and
only a subset of possible pixel combinations can be obtained. This
should explain the funny-looking text, etc.


* Assembling

You don't have to assemble tetris or tetrishr, they come as .P files
along with the source. But, since I'm distributing the source, it
makes sense to describe how to assemble it.

You'll need a Unix box, and the source to zmac, from comp.sources.unix
volume 9. Patch zmac with `zmac.dif', and compile it. zdis may not
compile - don't worry about that. Install zmac somewhere. Now do
`make' and it should build tetris.p and tetrishr.p. It'll also build
t1k.p, which you need to hand-hack a little to make tetris1k.p. See
the "About Tetris1k" section for details.


* About zx81send

Zx81send isn't needed for tetris but I figured I'd bundle it anyway;
it might be helpful if you want to play it/them (or any other .P file)
on a real ZX81. It `saves' a .P file with output to /dev/dsp on a
Linux box, such that if you crank the volume enough, connect the sound
output to a ZX81 and do LOAD "", you can load the .P file on the ZX.
What's even better is that it isn't as slow as loading from tape;
since all the vagaries of tape are avoided, there's no need to hold
back, and it goes as fast as the ROM load routine can handle - about
twice as fast as normal. (There's a compile-time option TAPE_VERSION
to slow it down if you want to record the output on tape for some
reason.)

It should also work on Suns, as it outputs u-law via /dev/audio if
`linux' isn't defined. It could probably be made to output a raw
sample file on other systems.

Note that your sound hardware will have to go LOUD for the transfer to
work. On my SB16 I have to have the master volume at about 80%, with
output gain at 100% (and PCM volume at the usual 75%). This isn't far
short of maximum volume. If your hardware won't go loud enough, you
may need to go through a hi-fi or use some other external amplifier.


* Distributing bin2p, zx81send, etc., separately

It's quite possible ZX81 hackers might find bin2p useful, and perhaps
some derivative of gentitle could be handy too. And doubtless the
hi-res routines will be of interest, and all true retrocomputing nerds
will be interested in zx81send. :-) No problem - everything here is
public domain. Copy/modify/distribute as you see fit. But I'd prefer
it if I was given credit in the source.


* About Tetris1k

Tetris1k is a 1k tetris clone. Because of the way the ZX81 screen
works, you have to run it on a 1k ZX81 (strictly speaking, one with
less than about 3k will work). On a real ZX81 the easiest way to do
this is unplug the rampack. On an emulator though, a simple "POKE
16389,68" then "NEW" before loading should do the trick. Certainly
this works on Z81; I haven't checked other emulators.

This 1k version was non-trivial, and I had to cut some rather major
corners. The most obvious problem is that there's no score at all.
(Sorry - I really didn't have the room to do it. The 10x21 screen
(this is HUGE for a 1k game) takes about 230 bytes, the shape data
takes 56, and the code 484. Figure in another 230 or so for sys. vars
etc., and there's barely room for the stack, let alone a decimal
output routine.) And the only prompt you get for "press a key to play"
is a question mark in the top-left of the screen. But apart from those
two problems, it's a complete tetris.

If you want to rebuild Tetris1k (ignore the rest of this section if
you don't), you have to do some work on the `t1k.p' as produced by
bin2p. Since bin2p is only designed to output .P files for 16k
machines, it puts the full 32x24 screen in the .P file (yes, ZX81s
save the screen - don't ask me why). There are various ways to fix
this, but the easiest is probably to use Z81 (or some other emulator)
like this:

POKE 16389,76		(gives you a 3k ZX81)
NEW
LOAD "T1K"		(this gives 0/30)
30 RAND USR 16515	(yes, really :-))
RUN			(runs the SAVE "Z" in the program)

After doing all that, exit the emulator, and rename `z.p' to
`tetris1k.p'.



* Contacting me

No email address at the moment I'm afraid. :-(

Postal address:
		Russell Marks,
		3 Rapley Close,
		Camberley,
		Surrey,
		GU15 4ER,
		United Kingdom.

If you insist on abbreviating my name, please use "R. J. Marks".
