
CHARACTERS
by David Mold
from ZX Computing Apr/May.1983

USER CHARACTER SET

Print upper and lower case characters with your ZX81 with
this clever program written by David Mold of Cheshunt.


Similar in nature to the user definable graphics program by
Chris Callender which appeared in the August/September issue
of ZX Computing, this program is rather more flexible in
that it will store a character set of up to 99 characters
and enable them to be LPRINTed simply by entering a string
(X$).

Once you have entered the program, you will be greeted with
the prompt:

NOW ENTER THE CODES FOR THE SPECTRUM CHARACTER SET

Simply type in the codes given for the lower case characters
(like on the Spectrum), and these will be placed in the
array, U.

You will now be given the prompt:

ENTER TEXT TO BE LPRINTED USING NEW CHARACTER SET

At this stage, you simply enter what you would like to be
printed in upper and lower case.

Any letters you enter as normal video will be printed in
lower case. Any letters entered as inverse video will be
printed as upper case. Numbers entered as inverse video will
actually be printed as normal video numbers, whereas if any
numbers are entered as normal video, they will be printed as
the extra characters which have been defined for them.


Extra, extra

If you have entered your own characters, having answered 'Y'
to the prompt:

DO YOU WANT TO ENTER YOUR OWN USER-DEFINED CHARACTERS? (Y OR N)

then they can be obtained by typing in the graphics
corresponding to the Sinclair codes 1 to 10 (for details
check out Appendix A of the Sinclair ZX81 manual). For
example, CHR$ 1 corresponds to the first user- definable
graphic.

Character definition should only be attempted if you
understand the way that a character is made up from binary
numbers (eight for each character). These numbers must then
be translated into decimal to be typed into the program. The
extra graphics characters, along with the number that has to
be entered to produce them is shown in Fig. 1.


Line by line

Before typing in or re-LOADing this program from tape, it is
important that you enter the following two lines (each
followed by Newline) as direct commands:

POKE 16389,124
NEW

in order to reserve space above RAMtop for the LPRINT
routine which is copied out from the ROM in lines 10 to 50.

Here follows a brief break-down of the structure of the
program.

Lines 100 to 170 copy from the ROM into the array S, all the
codes for Sinclair's characters, from '0' to 'Z' (normal
video). Lines 200 to 270 copy from the ROM into the array U,
all the extra Sinclair symbols, such as '*', ';', etc. These
will then be obtainable directly when the program is in use.

Lines 300 to 370 allow the user to enter the codes for the
lower case characters into the array U. (These codes are
shown in Fig.1). Every other line of this print-out has the
codes to be entered, separated by '/' to represent Newline,
and above each set of codes is the number that should appear
at the top of the screen when these codes are to be entered
(and represent the codes' positions in the array U). Lines
400 to 480 allow you to define your own graphics characters,
and enter them in decimal form.

Lines 500 to 700 allow you to enter whatever you wish to be
printed using the new character set, and then looks up the
codes for these characters in the appropriate arrays,
mapping them into the array A, for LPRINTing using the
subroutine from Sinclair's printer manual (lines 9990 to
9999). When all the arrays have been entered, lines 100 to
500 can be deleted. Line 1 should then be changed to read 1
SAVE "Characters". Connect up your cassette, start it
recording, then enter GOTO 1 as a direct command. Do not use
RUN or the arrays will be wiped. Make sure that all DIM
statements have been erased. The program, when LOADed, will
begin straight away, which avoids the danger of the user
typing RUN instead of GOTO to begin.


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Fig.1 The codes for the lower case characters -
      to be entered into the array, U.

28
255/0/0/0/0/0/0/0/
29
0/16/16/16/16/0/16/0/
30
60/66/153/165/165/158/64/63/
31
0/36/126/36/36/126/36/0/
32
16/56/88/146/16/16/16/16/
33
0/98/100/8/16/38/70/0/
34
0/48/72/50/76/72/54/0/
35
0/8/8/16/0/0/0/0/
36
0/126/36/36/36/36/36/0/
37
60/66/153/161/161/153/66/60/
38
0/0/60/2/62/66/62/0/
39
0/64/64/124/66/66/124/0/
40
0/0/60/64/64/64/60/0/
41
0/2/2/62/66/66/62/0/
42
0/0/60/66/124/64/62/0/
43
0/12/16/56/16/16/16/0/
44
0/0/60/66/66/62/2/60/
45
0/64/64/120/68/68/68/0/
46
0/16/0/48/16/16/56/0/
47
0/4/0/12/4/4/68/56/
48
0/32/40/48/48/40/36/0/
49
0/32/32/32/32/32/24/0/
50
0/0/104/84/84/84/84/0/
51
0/0/120/68/68/68/68/0/
52
0/0/56/68/68/68/56/0/
53
0/0/120/68/68/120/64/64/
54
0/0/60/68/68/60/4/4/
55
0/0/28/32/32/32/32/0/
56
0/0/60/64/56/4/120/0/
57
0/32/112/32/32/32/34/0/
58
0/0/68/68/68/68/56/0/
59
0/0/68/68/40/40/16/0/
60
0/0/84/84/84/84/40/0/
61
0/0/68/40/16/40/68/0/
62
0/0/66/66/66/62/2/60/
63
0/0/124/8/16/32/124/0/

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


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
