TECH TIPS

Simon N Goodwin

SIMON N GOODWIN nips round the back of his 128K Spectrums for a voyage into the unknown socket — and discovers further faces of Romantic Robot’s Multiface 3

ANY PORT IN A SOCKET

There’s a spare interface socket fitted to every 128K Spectrum, as readers keep reminding me. Tech Tips in CRASH Issue 41 explained that Sinclair is very secretive about the keypad socket labelled ‘AUX’ on the new +3. but since then I’ve had some success in finding out about this interface and controlling it from 128 BASIC. This is the story so far...

When the 128 first appeared — in Spain at the end of 1985 — a small box, rather like a calculator with no display, was connected to the keypad socket by a curly lead. The box worked as a numeric pad and provided extra functions in the BASIC editor. You can get the same effects with combinations of keys on the main keyboard, as noted in Issue 33 Tech Tips.

The 128 arrived in Britain In February 1986, but the keypad apparently didn’t come with it; all the keypads I’ve seen have been labelled in Spanish. That leaves most 128-users with a spare telephone socket at the edge of their machine and no information on how to use it.

There are a few hints in the back of the +3 manual, which says ‘the AUX socket supports two input lines and two output lines, connected to the AY-3-8912. Using software control loops the I/O lines could be driven as a second RS-232 port. Alternatively, they could be used to drive a robot or some external device.’

This sounded interesting, albeit easier said than done, so I plugged a six-way telephone plug into the long-suffering 128 that I share with fellow Techie Jon Bates and tried a few experiments.

KEY NOTES

The AY-3-8912 is the 128’s sound chip. I explained its inner workings in Issue 32 Tech Tips but didn’t say much about the 8-bit port built in. The four most significant bits of this port (values 16, 32, 64 and 128) are used for input, and the other four for output; two of each are allocated to the keypad and two of each to the RS-232/MIDI socket.

Reading from left to right as you look into the keypad socket, with the notch on the left, the first connection carries a +12-volt supply. The next is connected to input bit 5. Then come output bit 1, input bit 4 and output bit O. The last connection is a signal earth (0 volts).

These signals are adequate for most serial interfaces but not enough to connect a joystick, which needs five inputs. The Sinclair keypad contained electrickery to distinguish 15 different keys, but it couldn’t tell you if more than one key was pressed.

You must switch the port between input and output as required, by changing the value of bit 6 in register 7. The lower six bits are used to control the sound channels. It’s best to set them to 1 unless you want unplanned beeps and fizzes to accompany your experiments. The top bit, bit 7, is only used by the chip’s big brother, the AY-3-8910, which sports two 8-bit ports rather than one.

You use OUT 65533 to select a particular register (storage cell) in the sound chip. After that you can read and write that register’s value with IN 49149 and OUT 49149.

Use OUT 65533,7 to select register 7 in the sound chip, and OUT 49149,127 to set up the port for output. In theory OUT 49149,63 should allow input from the port, but I have not yet got this to work.

In any case, extra outputs are more useful than Inputs on the Amstrad versions of the 128, because they already have ten switch inputs — the joystick sockets, which you can read with IN 61438 and IN 63486.

Behind the scenes; X marks the secret socket on the back of all 128K Spectrums

DATA OUTPUT

Once you’ve set up the port you can output data through the keypad socket by writing to register 14. Don’t take much current from the socket, or short out the signals. It’s OK to connect a light-emitting diode, with a 2.2K resistor to limit the current, but you shouldn’t try to run a bulb or an electric motor directly from these outputs.

OUT 65533,14 followed by OUT 49149,2 sends the voltage on the third pin of the keypad socket diving from +12 volts to -11. OUT 49152,0 switches the signal back to +12 volts till you set bit 1 again.

The other output pin, the second from last, can be set to a negative voltage by writing an odd number to register 14. It’s only useful for short pulses because the system keeps resetting it to -12 volts.

I hope this information helps some of you put the keypad socket to use — and I’d be interested to hear from anyone who finds out more.

The Ram Music Machine: now you can analyse files in BASIC

MUSIC MECHANIC

AL STRAKER of RAMM!, the club for users of the Ram Music Machine, has revealed a couple of POKEs that convert sample files saved by the machine into standard CODE format so you can load them into ZX BASIC for analysis and alteration. (Music Machine files normally use filetype 4, which is not compatible with BASIC LOAD and SAVE commands.)

Leave the Music Machine program by entering ‘I’ from the main menu, and type POKE 39352,3 to make the software use file-type 3 for samples. Type RAND USR 27000 to restart the program. Now sample files can be read into ZX BASIC with LOAD " "CODE. (The format of sample files was explained in Issue 42 Tech Tips.)

POKE 39888,3 lets the Music Machine load CODE files. You can POKE 39888 back to 4 temporarily when you want to load files generated by the original version of the program.

Al Straker has previously contributed advice about mains interference and other Music Machine POKEs, so it’s high time he won our Tipster prize. £30 worth of software will be yours, Al, as soon as you let CRASH Mail Order know what you want.

MULTIFACETS

THE PROTOTYPE version of Romantic Robot’s Multiface 3 had no through port for other peripherals. This was particularly annoying because, unlike earlier Multifaces, it lacked a Kempston joystick port. Most new programs work with the peculiar ports on the Amstrad Spectrums, and you can plug a normal joystick into them via an adapter, but many old titles only work with the Kempston standard.

This problem has been cured, at a price — the Multiface 3 is now available in two versions. The Standard model costs £44.95. If you want to plug other peripherals in the back you’ll have to pay an extra fiver for a through port.

The Multiface 3 lets you use the +3 disk drive from 48K BASIC, which is not otherwise possible. You must select this BASIC with the SPECTRUM command from 128 BASIC, rather than using the 48K BASIC option on the main menu, which sets a lock that prevents access to the disk ROM.

The Multiface screen-printout routines are the same as the Multiprint large and shaded COPY formats, which I reviewed in the August CRASH. They use the machine’s built-in Centronics port.

The compressed file format is usually an advantage, because it makes loading faster and saves disk space. However, it can be a snag if you want to modify or disassemble a program file. With this in mind, the Multiface 3 lets you switch oft the compression and save files as exact copies of the contents of memory.

A pawn in the pirate war: Romantic Robot’s Multiface 3 offers cassette-to-disk transfer, but it could be thwarted by +3 programs

TRICKS AND TRAPS

Romantic Robot produced the Multiface 3 impressively quickly, and solved some interesting problems en route, but it’s unlikely that the Multiface 3 will be the last word in Spectrum cassette-to-disk transfer devices.

Similar gadgets for earlier versions of the Spectrum use an edge-connector signal called ROMCS to turn off the computer’s internal ROM and replace it with their own code. In this way they take over the system by redirecting processing to their own code when a button on the gadget is pressed.

But Amstrad has stopped these devices working on the +3 by disconnecting the ROMCS signal! The Multiface 3 gets around this by using two signals associated with the +3’s four ROMs: ROM1-OE and ROM2-OE. This way it can take control of any program intended for earlier Spectrums that runs on the +3. It’s important to note that the Multiface 3 won’t work with a 48K machine and could even damage an old computer.

PROBLEMS WITH +3 SOFTWARE?

The Multiface 3 may not work with new programs for the +3. That’s because the new Spectrum supports memory configurations intended for the CP/M disk option. and some of these entirely replace the system ROM with RAM, leaving no ROM for the Multiface to disable!

The Multiface normally runs in the ‘shadow’ of the ROM. If you press the magic button when RAM is in the relevant space, the Multiface 3 waits for the ROM to appear so that it can leap in. But no Spectrum lets an interface disable RAM... so the Multiface will never be able to interrupt games written specifically for the +3 and using the new memory configurations. As far as we’re aware nobody has yet released such a program, but no doubt it’ll happen soon.

This puts software houses in an interesting position. It means the +3 is the only Spectrum which can run programs that cannot be copied by a magic-button device.

NEW AGE HARDWARE

A Multiface has its antisocial side — it’s a powerful tool for a pirate. Unfortunately, I doubt the +3’s unique feature will bring an end to software piracy and a corresponding flood of commercial programs specifically for the +3.

It’s possible to make a superMultiface with its own processor, which could take over the system completely whatever the memory arrangement. Such a device would require a lot of new design work, and would be inherently more expensive than the Multiface 3.

And determined hackers, and those who sell products intended specifically for software theft, will probably prefer to learn how to copy protected disks...

TAPE TWEAKS

SEVERAL READERS have written in to say that Spectrum +2 loading problems can be cured by adjusting the position of the tape-recorder head. I’ve dithered awhile about printing this tip, because it’s easy to make things worse of you adjust the head carelessly. But I’ve decided to spill the beans, because it seems a large proportion of the +2 sold recently were not correctly aligned.

The cassette recorder in the +2 is the only mechanical part, and is therefore likely to be the most troublesome. If the head is incorrectly aligned it will tend to misread commercial tapes but the computer will probably still load things it saved without trouble — the misalignment cancels out if you load and save with the same machine, though even then there’s some loss of quality.

Check the alignment of your cassette unit by playing a well-recorded cassette — a professionally-duplicated music tape, say — through the computer and listening to the sound through the TV. The sound should be bright and clear; there may be a bit of noise or interference on the background, but don’t worry about that now (I hope to print the cure for that problem next month!)

If the tape sounds very full and bassy it’s likely that the head in the recorder needs to be repositioned. Before you do this, check that the tape is correctly positioned in the drive and that the door is properly closed, or you’ll have no hope of good results!

There’s a small hole in the top of the +2 box, between the cassette door and the control buttons. Press the eject button to open the door, and look into the hole. At the bottom is a screw which sets the angle at which the head passes over the tape. It’s when this angle is wrong that the problems start.

Turn the screw clockwise to raise the tape head or anticlockwise to lower it. Don’t use a magnetic screwdriver, and if possible use a plastic key rather than a metal screwdriver, as extra metal near the tape head confuses the circuitry. Be careful not to turn the screw far, or it could come undone completely: if one direction doesn’t help, or makes things worse, try the other way.

You should find a fairly narrow band where the sound is clear. If you’re careful you can use a blob of nail varnish (NOT Superglue!) to hold the screw in place so the alignment won’t have to be reset every time you use the machine.

CRASH reader S G Phelan sells a kit that includes further instructions on adjusting the +2’s tape head, and a knob-and-shaft assembly that fits into the top of the machine, making it easy to adjust the alignment at any time.

RODENT CONTROL

PAUL COTTON has written in bemoaning the lack of programs supporting the Kempston mouse system. He wonders if he can extract the mouse-control routines from Softek’s Artist II and use them in his own programs. He also wants a version of Rainbird’s Art Studio that works with the Kempston mouse.

I wouldn’t recommend extracting the Artist II mouse routines, though I’d be interested to hear from anyone who has done it!

The original version of The Art Studio only worked with the AMX Mouse, and Kernpston sold a special version with its mouse. Together they cost £69.95.

Kempston has now cut the mouse’s price to £49.95, and no longer sells the special version of Art Studio either with its mouse or separately. However, the Extended Art Studio upgrade DOES work with the Kempston mouse, and that’s available for £12.00 direct from Rainbird.

When it comes to using the mouse in your own programs, there are two options apart from hacking code out of an existing package. The £9.95 Kempston Toolkit includes simple facilities to add support for windows, icons and pointers to existing programs.

The £14.95 Spectrum Graphics Kit is more expensive but also more flexible, including an extended BASIC with new mouse commands. Both those programs are published by Kempston Data, and come bundled with the new £49.95 mouse package, at no extra charge.