Sunday, 25 November 2012

ZX Evolution


The tinfoil protects it from UFOs.
ZX Evolution is not an "old machine", but it continues the proud tradition of Spectrums in the 21st century. It is a new computer model based on the z80, compatible with Spectrum and Spectrum-related models, such as the Russian Pentagon.

The Evolution is not really meant to be a 100% authentic replacement for an original Spectrum, and it is not a Spectrum emulator either. As they say, it is a "hobby computer". This means it is good for building your own projects, no matter how big or small. You can enjoy making something simple like your own joystick connector, or you can try to rewrite the whole computer. Or you can be content playing games and watching scene demos. It's just that the foundation is a Spectrum compatible computer.

Basically, ZX evolution can be used for running original Sinclair Spectrum software as TAP files from a memory card. These files are available on emulation sites. The Evolution also reads TRD and SCL disk formats.

From Russia with Evol.
The package I received includes a short printed manual, a CD with software and information (mostly in Russian), stickers with the ZX Evolution logo and stickers for the keyboard with Sinclair Basic keywords. There is no power supply, connectors or any storage media. The manual, which is in English, is quite minimal, but it gives a detailed explanation of all the board connectors and pins and tells how to get the computer running. 

Stuff needed:

-A power supply
-A VGA monitor that can display 50hz and a VGA cable
-Alternatively you can use an RGB monitor/TV, but you need to build an RGB cable as there are only on-board jumper-style pins available.
-PS/2 compatible keyboard (My PS/2 - USB converter did not work)
-SD card (Not necessary, of course you can load games from tape)

ZX Evolution housed in a mini-ITX case, connected to a VGA monitor and a PS/2 keyboard.

ZXEvo for dummies

The simplest and most painless way to get ZXEvo up and running is to put it into a Mini-ITX case with a power supply. This is very easy and requires no special equipment or knowledge, only a screwdriver.

The board is larger than a Spectrum motherboard, so it does not simply fit inside an existing Spectrum case. This might be a pity for Sinclair fans, but it is hardly a big problem. However, with some creativity, I think it might fit inside a modified +2 case. The +2 case depth is about 170mm, which is the same as the board dimension.

I ended up buying an Antec ISK-110 VESA case, which offers good options for different positioning, including a wall mount. Nearly all the parts and faces of the case can be removed, and the cover is also quickly removable. This is quite important as otherwise it will be difficult to access the board.

Click the image for a closer look at this old Compaq keyboard/mouse combo,
fitted with the Evolution key stickers. 
In addition to the PS/2 standard mouse and keyboard connectors, the Evo board has pins for Spectrum-compatible keyboard and joystick inputs. Of course, these pins can be used for whatever switches you want to. The PS/2 functions as a Kempston mouse when used with old Spectrum software. It is also very simple to create mouse-based programs even in BASIC.

I used the front panel audio connectors for stereo out and tape in. I tested a cassette tape recorder for loading in an original Spectrum tape and (of course) it works. I also used Fuse spectrum emulator on Macintosh to send audio to ZXEvo audio in, with volume at maximum. If Fuse emulation speed is set to 200% and Evo is set to 7mhz, the files can be loaded in double speed. I can't vouch for the reliability of this method, though. Using 400%/14mhz did not work directly.

One thing I'm not yet certain is whether the RS232 port on board works as the Spectrum RS/MIDI port, of if it has some other purpose in ZXEvo.


Basic use

The first impression can be confusing. The screen is filled with numerous options and key commands. However, only few of these are important for the casual user. The screen has been clearly divided between settings and direct commands. There is some mouse support, but to be honest the direct key commands and cursor keys work better. 

The normal EVO Service boot screen.
Using reset (F12 on the keyboard) always brings back the boot screen. The EVO service boot screen is not the only boot screen, as it depends on the chosen service. Pressing 0 together with the reset should bring back the original EVO reset service.

Loading TAP tape images, TRD or SCL files from the memory card is straightforward. "File browse" can be used for selecting these file types. Tapes run instantly, and TRD and SCL also require to use "TR-DOS boot" option after the image has been chosen. Press reset button when bored to get back to the EVO reset service screen.

Pressing I and U keys boots a 48k and 128k Spectrum, respectively. The Turbo mode allows switching between 3.5mhz, 7mhz and 14 mhz CPU speeds.


TR-DOS what?

None of the following is really necessary for the normal use of the ZX evolution, as disk images can be mounted in the boot screen. When storing data and BASIC programs from the Spectrum to the memory card, it becomes necessary to learn some TR-DOS. The command SAVE "myprog" from BASIC does not store the program on the disk, as the computer will begin outputting the file as audio. 

The average Sinclair user may never have encountered TR-DOS, but it is quite big part of the ZX Evolution experience and very much used in the Russian Spectrum scene. One should know at least how to exit it! (Hint: It's the RETURN keyword.)

TR-DOS is basically a command set for a disk interface that was not part of the normal Spectrum. It originated in the UK, but it seems the later Russian computers generally used a modified TR-DOS for disk access. Here, it allows running and storing data to a ram disk or a disk image on the memory card. 

Thankfully, it's not very complex. In BASIC,  the interface is entered via RANDOMIZE USR 15616 and then the SAVE keyword works as usual. If the mounted image is on the memory card, the basic program will be permanently stored within that image on the card.

LISTing the contents of a disk image in "drive A" via TR-DOS.

When in TR-DOS, the commands are accessed through normal Spectrum BASIC keywords, which now have a different meaning. LIST lists the current disk image contents. Using LOAD "filename" loads and runs the chosen file. SAVE can be used for storing the current BASIC program into the chosen disk image. COPY can be used for copying files and so on. RETURN keyword exits the TR-DOS.

From the BASIC, RANDOMIZE USR 15616 brings back the TR-DOS. The disk interface can be accessed even if you did not boot into TR-DOS, as the interface is a permanent part of the ROM.

Viewing the SD card contents via TR DOS.
The later ZX Evolution firmware has been extended to allow mounting and manipulation of TRD disk images from the SD memory card from inside the TR-DOS interface. The memory card has its own file structure, the one that can be seen if you connect it to your PC and Macintosh. This is also shown by the EVO service file selector. The disk images on the card have their own internal file structure that is normally visible in TR-DOS.

Now, both file structures can be accessed from within TR-DOS. This can be confusing, as there are two "layers" of directories and a different command set for each of them. The new commands are preceded with a period (".") and these are typed in letter by letter. .DIR lists the contents of the memory card (and NOT the TR-DOS disk image), and likewise .CD and .MOUNT can be used to access the files on the card. .MOUNT filename drive: inserts the chosen disk image into the chosen virtual drive. .A:, .B:, .C: and .D: can be used to switch to that drive. Then the disk image contents can be viewed with the LIST keyword.

Assuming there is a folder called TRIMAGES in the SD card PC filesystem, and within that directory there is a TRD image called ELITE3:

.CD TRIMAGES
.DIR
.MOUNT ELITE3.TRD B:
.B:
LIST
LOAD "boot"

It appears confusing but as I already said, this is not really necessary for running software. The images can be mounted and booted from the EVO service file selector. Working with the TR-DOS can be messy, and it is not always obvious what is going on, depending on what machine has been booted. Sometimes it seems the ZXEvo insists on loading the boot file on the disk regardless of what I'm trying to do. So, a little persistence is needed.


Summary

A card reader and an original Spectrum is a good combination if you just want to run programs and games on the original, authentic hardware. Emulation is even easier choice. Pretty much everything can be made to run on an emulator these days. Emulators are good for cross-platform code development, as you can get your code running instantly. But honestly, emulation on its own gets a bit boring. There are no simple connectors for Do-It-Yourself projects. You also have to wait for the computer to boot up. Also, modern computers do not easily give solid frame rates.

Now, the ZX Evolution is a new computer, a continuation of the Spectrum lineage in Russia in the 90s. It is very open for simple modifications and personalization, starting from the casing and the keyboard. It is silent and the boot time is instantaneous. The Evo can also run various different versions of the Spectrum-style computers, and is not limited to the original hardware.

ZXevolution page on NedoPC

NedoPC site

http://zx.rediron.ru/ (ZX Evolution site, in Russian)

Blog post about installing TS-Conf

Sunday, 18 November 2012

Spectrum 128 and MIDI




Information on MIDI and the ZX Spectrum is available on the net but it is a bit more scarce than one might think. So I'll try to collect some of the useful things here and also fool around with Spectrum and MIDI.

The RS232/MIDI port on the back of the Spectrum is not a standard MIDI port, obviously. But making it work is not a matter of simply rewiring the port, as it needs a few resistors and a transistor. Also, a somewhat obscure plug is needed if one does not wish to build the cable directly into the Spectrum.

Pictured, a BT-like plug and a DIN-8 connector, which passes for a MIDI port.
The plug at least looks like a BT cable, 631A, with all the six pins. The plastic parts may need some changes before it fits the Spectrum port. For the MIDI connector, I used an 8-pin DIN, which has more pins than a MIDI port requires, but as long as there are holes in the correct place it does not matter. My MIDI connector is built according to a document by Ben Versteeg at benophetinternet.nl/hobby. Direct link to the document is here.

The white cable is connected to the RS232/MIDI port. Yes, it looks a bit messy now.

Programming MIDI via BASIC

Try as I did, I could not really find a proper MIDI sequencer for the Spectrum. I suppose around 1986 onward nobody in UK did little else than games for the Spectrum. Possibly the russians have made something for their Pentagons and Scorpions, but they might not work on a vanilla machine.

Fortunately, BASIC offers a simple way to test the port in action. The Sinclair Spectrum 128k introductory manual describes all the commands. Perfectly timed sequences can be built out of text strings. As the Spectrum BASIC allows fairly flexible string manipulation, tunes can be structured programmatically. The single PLAY command then initiates the whole multi-channel sequence.

The pseudo-full screen BASIC editor in 128 Spectrum.
Something like this was used to create the loop in the video above.
 
The example below should be valid in 128 BASIC:

10 LET a$="T120Y1M1O3N((1e1e1e1e1e1e1e1e))"
20 LET b$="T120Y1M1O3N((1c1&1&1&1&2&1&1&))"
30 PLAY a$,b$

The example plays notes simultaneusly on two channels. T sets the tempo at 120BPM. Y is the important command here, as Y1 selects the MIDI output channel #1.

The actual tune is controlled by the codes within the character strings. Lower case letters cdefgab play the notes on the octave, whereas upper case letters CDEFGAB play notes on a higher octave. The & denotes a rest. The notes are preceded by a number (1-9) that defines their length. Using a # indicates a sharp note. The brackets are used to repeat a section, and this can be done to up to four levels. Here I'm looping the contents four times.

M selects the channel (not needed for MIDI I think). O1 sets the octave at the second lowest octave. N is used to separate numbers from each other. It seems to be a good practice to insert it at least between the setup and the notes. Z apparently would send out raw MIDI data, but I'll see about that one later.

A 32-step sequencer with two channels.
It's fairly easy to sketch out graphical ways for creating sequences. as the data can always be "compiled" into the strings and played. However, in BASIC these things are notoriously slow. One thing to avoid is trying to build loops or song structures with GOTO commands. It just won't work. It's better to append the whole song into the character strings and use a single PLAY statement.

To be continued...

The Spectrum connected to a KORG Electribe sampler.

Sunday, 4 November 2012

Spectrum 128k+2 MINI summary


The above shows a modified Sinclair Spectrum+2, side to side with the original rubber keyed Spectrum 48k. I removed the integrated tape recorder. I have described the modding process with detail. Links to Part I and Part II. As an add-on, the picture shows the Divide 2k11 compact flash card reader, which removes the need for tape loading.

I bought my Divide 2k11 from Lotharek.

If you want to repair the tape recorder instead of removing it, here are some pointers.

RWAP software is worth mentioning. They sell keyboard membranes for the Sinclair series.

Schematics for building an RGB cable for the 128k +2. Fortunately this one is probably the simplest to build.

Alternatively, you can order one online from Retrocables. It can come off cheaper than building your own if you don't have the parts and equipment already.