All the Colours We Have (for Paul Carter)

It’s hard to believe that Paul Carter has been gone ten years. I realized that my original ZX Spectrum BASIC memorial to him had got a bit dusty, in that it ran as an outdated Java applet. So I rewrote the code, and put it here: All the Colours We Have (for Paul Carter).

Spectrum is Green!

My previous adventures with my Sinclair ZX Spectrum 48K in Canada were not resounding successes. I couldn’t get the display to work, and tapes wouldn’t load well, so I’d been using Fuse while the hardware sulked in a cupboard.

I’d previously got a proper power supply (9 V DC, ≥ 1.4 A, centre negative) and bypassed the PAL UHF modulator to give composite video. No television, monitor or converter box that I had tried seemed to give a useful display.

Back in May, Walter Miraglia brought a tiny 7″ composite colour monitor to TPUG‘s Retrocomputing Night. He let me try it with the Spectrum, and it worked very well. Walter said it was an extension monitor for a car DVD player.

I dug around, and found that local surplus clearout store Tech Source Canada had the Philips 7″ portable DVD Player PD7016/37 for $60. This gives you two identical DVD players with composite input. I think my other one will be destined for a Raspberry Pi project somewhere.

To get these monitors running, you’ll need:

  • a 9–12 V DC power supply able to give ≥ 1 A. I use a regulated supply that gives 9.1 V open circuit and is rated at 2 A. Note that the power connector is slightly smaller than the common 2.1 mm barrel, so you may have to order this one, unless you can solder something up.
  • A cable like this 3.5mm Stereo to Composite Video + Audio Cable (3 RCA). These are sometimes just called camcorder cables. They use a 3½ mm TRRS jack, and can also — if you don’t mind not quite having the connectors in the right order — work with the composite/audio output of more recent Raspberry Pis. Tech Source had these for under $5.

Connect it up , and — success! Well, slightly qualified success. The screens do not have the greatest resolution, so pixels are slightly smeared together. The screens do have a decently fast refresh, and the whole look is just right. With its colour clash and dot crawl, nobody ever expected great video from the Speccy anyway.

Here are some screen shots taken with my phone, and a couple of pixel-sharp screenshots from Fuse to compare:

Moon Cresta - complete with authentic weird language
Moon Cresta – complete with authentic weird language
Moon Cresta — the same screen from Fuse
Moon Cresta — the same screen from Fuse
Moon Cresta - nice loading screen
Moon Cresta – nice loading screen
Manic Miner — a game I am not good at
Manic Miner — a game I am not good at
Manic Miner - perhaps the (deliberately?) worst game music ever
Manic Miner – perhaps the (deliberately?) worst game music ever
3D Death Chase — OH NOES A TREE!!!!1!!
Deathchase — OH NOES A TREE!!!!1!! Looks like the Riders of the Big Bikes just lost another member
Knight Lore
Knight Lore
Chuckie Egg
Chuckie Egg
Chuckie Egg from Fuse. We can't do anything about the attribute clash
Chuckie Egg from Fuse. We can’t do anything about the attribute clash

So I can now definitely view the screens. Huge thanks to Walter for tipping me off to these DVD players.

[Incidentally, the screens are designed for car use, so don’t stand up properly unless you get creative with some supports. I laser-cut these out of 3 mm plywood:

mini screen feet for 3 mm ply
mini screen feet for 3 mm ply. Cutting template PDF is linked underneath this image

Glue the little sticks on to the flat ends, and they’ll fit into the slots in the back of the monitor. Here are the feet with the sticks fitted:

screen feet with sticks glued in place
screen feet with sticks glued in place

There are better-designed feet than these, but they work, mostly.]

I was still having game loading problems. Try as I might, I couldn’t get anything to load reliably. Retrocomputing Stack Exchange came to the rescue, in the shape of mcleod_ideafix’s very helpful answer.  If your audio player is running from batteries and you can use a stereo cable, you can convert the normal mono loading audio into stereo with one channel inverted. This gives you effectively double the volume, and works quite well with my audio player, an old Edirol R-1*.

Inverted stereo loading data, showing 4000/8000 Hz speedload tones
Inverted stereo (or differential) loading data, showing 4000/8000 Hz speed-load tones

This audio will not load into an emulator, or work with a mono cable. Some audio players even render it as silence.

Here’s a script to take monophonic loading data and convert it to this faux-differential stereo format using Sox:

#!/bin/bash
# wav2differential.sh - convert mono game tape audio to 2× stereo
# usage:   wav2differential.sh infile.wav
#          (creates  infile-differential.wav)
# scruss - 2016-06-07
# method by ‘mcleod_ideafix’; many thanks / greetz
#   — https://retrocomputing.stackexchange.com/a/774/439

base="${1%.wav}"
sox -q --norm=-3 "$1" -b 16 "${base}-n.wav"
sox -q  "${base}-n.wav" "${base}-ni.wav" vol -1.0
sox -q  --norm=-0.1 -M -c 1 "${base}-n.wav" -c 1 "${base}-ni.wav" -c 2 -b 8 "${base}-differential.wav"
rm -f  "${base}-n.wav" "${base}-ni.wav"

If you want to check your audio levels, sox can also create the 800 Hz header tone used by the Spectrum. Run the output of the command below through the script above, load it onto your audio player and fiddle with the volume until the border flickers steadily:

sox -n -b 8 -r 8000 800hz-header.wav synth 30 square 800
Lovely loading bars ...
Lovely loading bars …

I was also looking for the games to load fairly quickly. Tapes used to take over three minutes to load, and while retrogaming all is about the experience, I haven’t got time for that. Fuse has some utility programs which will convert a .Z80 game snapshot into an audio file that loads in about 1¼ minutes.

To convert the snapshot to a speed-load TZX tape image:

snap2tzx -o game.tzx -s 3 game.z80

To convert that virtual tape image into audio:

tape2wav -r 16000 game.tzx game.wav

You can then run that WAV file through the stereo/differential script I listed above. Have fun!

another partial success…

chuckie_egg-loading

I guess I’ve had some qualified success in getting the ZX Spectrum going. After finding the right (mono) cable, sticking it in the Spectrum’s EAR socket, converting tape images to audio with tape2wav, and getting a PAL/NTSC converter, I can load stuff. Sort of.

chuckie_egg-dotcrawl

The problem is mostly with the video converter; it’s too slow. The screen refreshes a couple of times a second, which is enough to lose many Hen-House Harrys. I know, I should’ve gone for a more expensive one.

I’ve found that the audio files made by tape2wav are very loud; 0 dB, full deflection, distort-o-matic. Dropping the volume to -3 dB made games load better. Adding a couple of seconds of silence at the beginning of the file wouldn’t hurt, either.

ZX Spectrum → Canada

Ah, the ZX Spectrum… so many hours of my youth wasted on this book-sized computer. Now anything with a display can emulate one in its spare processor cycles, the 30 year old hardware itself is a bit chunky:
IMG_0623That’s a lot of discrete components; all through-hole, too. I brought this one back from the UK earlier this year in the hope of getting it working.

First item that needed attention was the power supply. The original had a 230 V AC to 9 V DC, 1.4 A supply of some extremely dodgy regulation. I replace this with a Circuit-Test AC/DC Adapter – 9 V DC 2.2 A, which will have plenty of current. Since the adapter has a 2.1 mm centre positive DC barrel connector, and the Spectrum uses a centre negative connector, I used the soldering opportunity to wire in an inline switch. The Speccy’s famous lack of a power or reset switch really isn’t part of my retrocomputing experience.

Next up, bypass the UK PAL TV modulator. This required disassembling the computer, and disconnecting the legendarily fragile keyboard membrane edge connectors. It’s a very simple soldering job to re-route the composite video feed (dot crawl and all) from the PCB to the Video Out. Put it all back together, plug it into the TV, and:

IMG_0971

… another partial success. My TV doesn’t talk 50 Hz PAL composite well, giving an oversized black and white display. I’ll either need to buy a PAL to NTSC converter box, or spring for a tiny monitor which supports both standards.

wrong in every possible (good) way

deathchase on rockbox on sansaI found my bricked Sandisk Sansa E250 in a pile in the basement. I thought I’d give it one last try to get it going. After much faffing about, I found that applying this fix – Corrupted version.txt/Fw update not working in recovery mode? The solution !!! – Sansa e200 FAQ – abi>>forums (which resulted in a failed boot saying something about an mi4 not being found) followed by Recovering a bricked Sansa had it working with the fairly awful Sandisk firmware. So it was off to Rockbox for the latest version.

I have to say, Rockbox 3.4 is pretty neat. They’ve now got proper USB reading/writing/charging, so that you never have to see the clunky Sandisk UI again. When plugged in, the player acts as a USB keyboard for controlling your music. Apparently the E250 can now support MicroSDHC cards, which it couldn’t before. But best (and least useful) of all, is that you can play 3D Deathchase and other ZX Spectrum games on it …

Paul Carter, 1970-2006

Paul Carter died in a car crash yesterday near Edinburgh. We were inseparable as kids.

He was an inspired artist, even when I knew him. I’ll never forget him asking of his ZX Spectrum: How do I get more colours from this?

Stewart and Paul, 1983

This is me and Paul (right) in the summer of 1983. Paul was wearing his Beatles t-shirt, as usual; I think he’d just painted his bedroom wall with scenes from Yellow Submarine. We were just about to set out on a sponsored cycle. We belted round the track at Crookfur Park until everyone else had gone home, leaving one poor hapless lap-counting volunteer waiting in the dusk.

Some of Paul’s artwork on the web:

Update, 21 Aug: Paul’s funeral is this Friday in Joppa at St Philip’s Church, Joppa Road at 10.30 am. There is a wake in the church hall after until 1pm. Thanks to Chris Hill and John Beagles for finding this.