Unix pages
Home -> UNIX software -> PSF Tools -> Amstrad Font Redefinition -> PCW Characters

PCW Characters article by Richard Fletcher

Richard Fletcher builds on the work of Cliff Lawson to patch a new character set into the .EMS file, allowing it to be used in LocoScript as well as CP/M.

Files

Font

The font generated here is a subset of the set from Cliff Lawson's article, redefining only A-Z and a-z.

PreviewDownload

Article

Here is the original article in full:

PCW Characters

Have you grown tired of your PCW’s screen appearance? Now you can change how the character set looks, even within LocoScript, with this routine from Richard Fletcher

Buying an Amstrad PCW8256 was one of the best decisions my wife ever made for me, and I readily add to the praises heaped on this machine since it began to arrive on the desks of a grateful nation.

As a word processor there has never been a machine which can touch it for value for money. That it's also a full-featured computer is cream on top.

With a computer like this there is little to quibble about — except, that is, for the character set.

I PREFER my computer screens to look uncluttered. Unfortunately, this isn’t the case with the PCW screen. Amstrad seems to have tried to make the display look familiar to people more used to reading magazines than VDUs.

The PCW character set is full of nasty little bits called serifs, and they make my eyes ache.

So, what can you do about it? Can you change the on-screen characters? The answer is an emphatic Yes. While idly browsing through the April 1986 issue of Amstrad Computer User (which some of you will remember spawned Amstrad Professional Computing, which has now spawned Amstrad PCW Magazine), I found an article by Cliff Lawson describing the construction of an RSX to alter the PCW character set.

RSXs are very useful for temporarily altering the system. They can be Gencom-ed to any .COM file and will act whenever that file is run. Unfortunately, attempts to Gencom LocoScript (the file is called Script.joy) are doomed to failure because it isn’t a .COM file. The operating system file (the one with the .EMS filetype) has been delicately butchered to make both it and LocoScript into a single system so alterations arc not encouraged.

But to a certain type of mind this kind of lock is ineffective; in fact it provides a ready source of entertainment.

So now to the bit you've been waiting for: How to get at the insides of J20loco.ems, the operating system for LocoScript, and do some butchery of your own to create a more readable set of characters on screen.

On the inside

First make a copy of the LocoScript master disc, and put it aside for security reasons. Next reset the machine (by pressing the Shift, Extra and Exit keys together) and insert the CP/M Plus disc. When the A> prompt appears, enter (press Enter or Return after each entry):

A>pip
*m:=a:set.com
*m:=a:pip.com

and then press Return to bring back the A> prompt.

This copies the files Set.com and Pip.com into drive M where they will do some good. Set is a very useful little utility — we’ll use it to force the hidden files to show themselves so that we can play with them.

When the disc drive stops, put the new copy of the LocoScript disc into the top drive and enter:

m:set a:*.* [dir]

When the prompt returns, enter Dir and you’ll find that you now have some new files. Actually, you had them all the time but they they’re no longer hidden from view.

Now you can see a file called J20loco.ems. Copy this to drive M using Pip, as follows:

m:pip m:=a:*.ems

This is the copy we will alter. Working in drive M means we can’t possibly do any damage to the disc, no matter how hard we try. When altering programs. I always work on a copy in M with nothing in the disc drives. I learnt the hard way!

Now we need to use the disc with the machine code monitor called Sid.com on it - you’ll find it on side 3 of your master disc. Use Pip to copy it into drive M:

m:pip m:=a:sid.com

To run the monitor just enter Sid which loads and relocates itself to the top of the TPA (Transient Program Area). Then load in j20loco.ems at 0100. I’ll tell you how in a minute, but first a discourse into what we need to search for in the file > and how I found it.

We need to look for the area of the file containing the bytes representing the PCW’s character set. My own machine code monitor lets me search for a string of hex characters, so I looked for the sequence of bytes 18,18,18,18,18,00,18, which represent seven of the eight bytes making up the exclamation mark character.

If you put an exclamation mark on the screen and position the cursor over it there isn’t any problem puzzling out which pixels are lit in each line of the vertical part of the character — bits 3 and 4 representing decimal 8 and decimal 16 (8 + 16 = 24, decimal 24 in hex 18.

I hit it first time at location a4b8. Beginner’s luck I suppose. Dumping from eight bytes back (a4b0) gave me eight zeros (the space character) and then these eight bytes making the exclamation mark.

The character-set bytes are stored in the same order as shown on page 113 of the CP/M user instructions in the blue book supplied by Amstrad. So, counting forward gives us the upper case letter A at a5b8.

Dumping the bytes at a5b8 gave me the beginning of the alphabet. You can start to look at this when you’ve loaded J20loco.ems.

The next thing I did was to use the Examine command (called Substitute in Sid) to check each byte and then change it. This took about 15 minutes. Then I saved the altered program and put it on to a disc with Script.joy and Matrix.std files (for the printer codes).

Now to the business of using Sid.

When you run Sid (enter M: to log on to drive M and then enter Sid) you get the message:

CP/M 3 SID - version 3.0

Don’t forget to remove all discs now &mdask; just to make sure you’re safe.

Use the E command to get Sid to load J20loco.ems:

#Ej20loco.ems

Sid will find the file and load it at the beginning of the TPA (starting at 0100). You will see the message below which tells you how big the program is:


NEXT MSZE  PC  END
B100 B100 0100 DAFF

The hex value given under END may be different for your version of LocoScript.

As an interesting aside, if you request a hex dump with the instruction #Da5b8 Sid will spill the beans about your machine’s insides in 16-line chunks with 16 bytes to a line. For good measure it shows some of the bytes as printable characters by the side of the listing.

To alter the bytes in memory, enter the command Sa5b8 after the prompt. Like so:

Sa5b8

Sid will reply with:

A5B8 18

The cursor will be to the right of the 18, and it sits there, unblinking, waiting for you to decide the next move. Don’t let it panic you. lake it slowly and enter the byte 3c (no need for upper case letters). You’ve now changed the value of location a5b8 from 18 to 3c.

Sid will display the next byte at a5b9 and you just have to enter the value to change it to — in this case 66. Keep going in this way and you should end up with a screen like the following, which has redefined the letter A:

A5B8 18 3C
A5B9 3C 66
A5BA 66 66
A5BB 66 7E
A5BC 7E 66
A5BD 66 66 
A5BE 66 66 
A5BF 00 00
A5C0

Continue this until you reach lower case z:

A780 00 00
A781 00 00
A782 7E 7E
A783 4C 0C
A784 18 18
A785 32 30
A786 7E 7E 
A787 00 00
A788 0E .

All the relevant bytes and their locations are shown in Figure 1. Every second letter begins on a number ending in zero, so this gives a useful check.

When you reach location a788 (which contains the value OE), type a full stop and press Return. Sid will take you back to the hash (#) prompt.

If you make a mistake at any time do the same thing: Press the full stop key and at the # prompt enter S followed by the last correct entry. You can go over the whole character set any number of times.

Note that just pressing Return takes you to the next byte and leaves the original number in memory unaltered. This makes life easier if the number in Figure 1 is the same as the one in memory. None of the symbols between upper case Z and lower case a need to be altered, so you can whizz through them without a care.

After entering all the values, you will have a customised version in memory. You now need to W(rite) the memory to disc, so at the # prompt enter:

£Wjoy20loco.ems

Sid will save the file to drive M and display:

0160h record(s) written

Leave Sid by pressing the Alt key and C together, and put your LocoScript disc back into drive A, You now have to erase the old J20loco.ems file and transfer the one you have just created. So, at the M> prompt, a: returns you to the A> prompt, at which you enter:

era j20loco.ems

and then:

m:pip a:=m:j20loco.ems

This puts on to the disc the new version of the operating system file with the changed character set in it.

The procedure for altering j14cpm3.ems, the CP/M Plus operating system file, is the same except that the character set lives lower in memory. You’ll find the space character and exclamation mark at 4EE0. All the rest is similar.

Now remove the disc and reset your machine. Insert this fine new disc and watch it come up with the usual LocoScript sign-on message in a nice clean font.

If you don’t like some of the characters you can make your own fine adjustments, but at least things are now under your control.

Character locations, and their altered values
A5B0: 7C C6 DE DE DE C0 7C 00 3C 66 66 7E 66 66 66 00 --(@)--(A)
A5C0: 7C 66 66 7C 66 66 7C 00 3C 66 C0 C0 C0 66 3C 00 --(B)--(C)
A5D0: 78 6C 66 66 66 6C 78 00 7E 60 60 78 60 60 7E 00 --(D)--(E)
A5E0: 7E 60 60 7E 60 60 60 00 3C 66 C0 C0 CE 66 3C 00 --(F)--(G)
A5F0: 66 66 66 7E 66 66 66 00 7E 18 18 18 18 18 7E 00 --(H)--(I)
A600: 0C 0C 0C 0C CC CC 78 00 66 66 6C 78 6C 66 66 00 --(J)--(K)
A610: 60 60 60 60 60 60 7E 00 6C FE FE D6 D6 C6 C6 00 --(L)--(M)
A620: C6 E6 F6 DE CE C6 C6 00 7C C6 C6 C6 C6 C6 7C 00 --(N)--(O)
A630: 7C 66 66 7C 60 60 60 00 7C C6 C6 C6 DA CC 76 00 --(P)--(Q)
A640: 7C 66 66 7C 6C 66 66 00 3C 66 60 3C 06 66 3C 00 --(R)--(S)
A650: 7E 18 18 18 18 18 18 00 66 66 66 66 66 66 3C 00 --(T)--(U)
A660: 66 66 66 66 66 3C 18 00 C6 C6 C6 D6 FE FE C6 00 --(V)--(W)
A670: C6 6C 38 38 6C C6 C6 00 66 66 66 3C 18 18 18 00 --(X)--(Y)
A680: FE 06 0C 18 30 60 FE 00 3C 30 30 30 30 30 3C 00 --(Z)--([)
A690: C0 60 30 18 0C 06 02 00 3C 0C 0C 0C 0C 0C 3C 00 --(\)--(])
A6A0: 18 3C 7E 18 18 18 18 00 00 00 00 00 00 00 00 FF --(↑)--(_)
A6B0: 30 18 0C 00 00 00 00 00 00 00 78 CC CC CC 76 00 --(`)--(a)
A6C0: 60 60 7C 66 66 66 7C 00 00 00 3C 66 60 66 3C 00 --(b)--(c)
A6D0: 0C 0C 7C CC CC CC 74 00 00 00 3C 66 7E 60 3C 00 --(d)--(e)
A6E0: 3C 66 60 78 60 60 60 00 00 00 3C 66 66 3E 06 3C --(f)--(g)
A6F0: 60 60 7C 66 66 66 66 00 18 00 18 18 18 18 18 00 --(h)--(i)
A700: 06 00 06 06 06 66 66 3C 60 60 66 6C 78 6C 66 00 --(j)--(k)
A710: 30 30 30 30 30 36 1C 00 00 00 6C FE D6 D6 C6 00 --(l)--(m)
A720: 00 00 5C 66 66 66 66 00 00 00 3C 66 66 66 3C 00 --(n)--(o)
A730: 00 00 7C 66 66 7C 60 60 00 00 7C CC CC 7C 0C 0E --(p)--(q)
A740: 00 00 7C 66 60 60 60 00 00 00 3C 60 3C 06 7C 00 --(r)--(s)
A750: 30 30 3C 30 30 36 1C 00 00 00 66 66 66 66 3C 00 --(t)--(u)
A760: 00 00 66 66 66 3C 18 00 00 00 C6 D6 D6 FE 6C 00 --(v)--(w)
A770: 00 00 C6 6C 38 6C C6 00 00 00 66 66 66 3E 06 3C --(x)--(y)
A780: 00 00 7E 0C 18 30 7E 00 0E 18 18 70 18 18 0E 00 --(z)--({)

John Elliott 2020-12-21