Sunday 27 January 2013

SVI/Spectrum keyboard, continued

As a continuation of the Spectravideo/Spectrum keyboard modification, I needed to get a bit deeper into how the key combinations work in the later Spectrum models to replicate the effect in my keyboard. Converting the SVI keyboard to function as the normal Spectrum keyboard was simple, if tiresome. The Spectrum 128/Plus has dedicated Delete, Edit and Arrow keys, and these pose additional problems for the hobbyist keyboard builder.

So, once more, from the top:

Similar, yet different... the delete (backspace) in the old Spectrum requires
pressing two keys simultaneously.
With the old Spectrum, it's clear how one keypress is transmitted to the computer's brain. (The ULA chip plays an important role in this but I need not go there) The row and column connectors form a matrix, where each one key produces a unique combination in the table. But, when multiple keys are pressed, such as combination of CAPS SHIFT and any key, multiple connections are also made.
Pressing a single key, a connection is made between
the row and column connectors on the Spectrum  motherboard.

Here I am using DELETE function as the example key, and it is also the first one I am physically building. With the rubber-keyed Spectrum, the typist had to press both CAPS SHIFT and 0 (zero) key together to backspace(!) Using these kind of compromises, designers at Sinclair could reduce the amount of keys to 40, which is exactly 5x8.

Pressing CAPS SHIFT and 0 together on the old Spectrum gives the backspace function. 

The later Spectrum keyboards have a dedicated DELETE key, among a bunch of other new keys. Yet there are no more connections in the Spectrum+/128 keyboard membrane than in the original. In fact, these newer keyboards ought to be perfectly interchangeable with the old Spectrum keyboards. Looking at the keyboard membrane of a 128 reveals a mish-mash of wires:

A Spectrum 128 keyboard. Slightly more complex.
(Click the picture to get a bigger version)
Pressing the Delete key therefore has to produce exactly the same kind of connections to the motherboard as when pressing CAPS SHIFT and 0 on the original Spectrum. So far, this is pretty clear: Even with the Plus keyboard it is possible to get the "delete" in the old fashioned way, by pressing CAPS SHIFT and 0.

The DELETE key is pressed. (Simulating the Caps shift and 0 key)
The elements in the tri-layer membrane are brought together simultaneously.

How the plus/128 membrane works is that it seems to have three membrane layers instead of two. Each combination key press produces the needed connections mechanically. I've not verified physically that the Delete key especially needs all the three layers, but just to be on the safe side I have based my SVI keyboard work on this assumption.

One clear message here is that both of the connections must be activated only for the duration of the key press. For example, it is not possible to have one wire permanently connected as it would mess the entire keyboard functionality.

Building the SVI key

After clarifying the keyboard mechanism visually to myself in the above manner, I could encourage myself to replicate the way the connections work in the extra keys of the plus/128 model. This requires a further modification to the SVI keyboard circuit board. I have cut the normally two-sided keyboard element into a three-part one, mimicking the way the three-layered membrane works.

Simplified view of one key in the Spectravideo keyboard circuit board.
Left: The normal, two-part connector. Right: The modified, tri-part connector.
The dotted circle shows the estimated area covered by the conducting "peg" in the key above. 

I have built the Delete function into the SVI backspace key, and it works. Just about.
This hack is problematic because the conducting peg under the key does not so easily cover all the three parts. So, even if the theory is sound, the key is not very responsive.

Monday 21 January 2013

Intermission: The Horace trilogy

In all their 16k glory.
I hardly collect games, but this time I wanted to acquire physical copies of the three original Horace games for the Sinclair Spectrum. They are not rarities, on the contrary, one of them is probably available at any one time on eBay for a reasonable price. The cartridge versions fetch good prices, though. Well remembered and surely nostalgic, Horace games hail from around 1982-1983. It makes me think how time has passed: at the time of their release, films such as "Rebel without a cause", "High Noon" and "Forbidden planet" were about as old then as these games are now!

These are pretty nice games given that they fit into 16k. I'll dismiss the fourth Horace game as it is not written by William Tang and thus is not "canonical". Let's see what the trilogy has to offer...

Hungry Horace:

I'm surprised they did not call it Hungry Horace 3D.
"Inspired" by Pac-man, Hungry Horace introduced the Horace character to the masses. The maze is simpler than in the Namco game, except that it has the occasional overlapping portion. In the first maze there is only one opponent, a park guard, chasing Horace. Horace eats flowers, but does not have to eat all of them. Ringing the alarm bell reverses the situation for a while: now the guards can be "thrown out" of the park. The instructions make it pretty clear that no one dies in this game: if the guards catch him three times he will merely not be allowed around the park anymore.

To distinguish himself from his yellow colleague, he has the dignity of having no gaping mouth. Horace is all eyes and feet, a kind of anti-pacman. As a further reversal Horace is also blue, which in video-speak is the opposite of yellow. The lack of mouth also cleverly symbolizes hungriness, as who could be hungrier than a man with no mouth? Then again, who says those two openings are eyes, as I've always assumed? Perhaps he has not one, but two mouths. Or maybe they are nostrils. Is that protrusion a hand, a tail, ponytail or some other appendage? The mystery remains...

Horace goes skiing:

One of the earliest examples of product placement in a video game: MH Hardware.
I always felt this was the quintessential Horace game, with the most rewarding overall gameplay and the best title: Horace goes skiing. These later Horace games were clever in that they "homage" not one, but two arcade hit games. HGS combines elements from both Alpine ski and Frogger. Horace has first to grab a pair of skis, conveniently placed on the other side of a densely trafficked road. The traffic is pretty fast and changes in density. Each type of vehicle has a different speed. Choosing the right moment to cross can be a nerve-wracking exercise, as the choice has to be made with intuition coupled with a grain of luck.

Should Horace suffer a traffic accident, an ambulance will helpfully drive to the rescue. The ambulance also patrols the road while Horace attempts to cross it, and it's not rare to get smackered by it, as it is the fastest of the vehicles.

It's karmic. No, wait, I meant kathartic.

After getting the skis, he has to return to the other side of the road. Then the downhill skiing, the "Hannekon run" (No I don't get it either) may begin. This is the more relaxing part of the game, but it is not wholly without danger. Should Horace break the skis, he has to rent another pair. All the collisions with the cars and the trees make pretty nasty viewing, in contrast to the strictly non-violent nature of the first game. But in fact there's really no ill-will demonstrated, it's more like educating the kids about the dangers of traffic and skiing. Don't go outside, it's a scary world out there. Better sit in front of the computer and play Horace.

The idea of a two-part game is successful as the good gameplay is rewarded with further, different gameplay. The later part is also easier and somewhat more relaxing compared with the hectic streetscape. This further reinforces the idea of the second part as a reward to the first.

Horace & the spiders:

"Hungry Horace and the spiders ... from Mars", one could almost say. By the third game, Horace's stature as a major British cultural export began to equal that of David Bowie. As a final tour de force, Horace & the spiders features three parts, completing the trilogy with a three-parter of its own. Thus the Horace trilogy is structured as an ever more intricate spiral of complexity, beginning from the humble pacman-like beginnings of the first game, and ending up with a metaphorical recapitulation of the trilogy itself: Wheels within wheels.

A spider.
I'm not sure if the first two parts of this game resemble any single game in particular, but I would not be surprised that it has some direct precedent, possibly Jungle hunt. (Another might be Smurf rescue on the Colecovision). Horace runs across a scrolling landscape, jumping over some spiders and trying to avoid getting tripped over by a cliffside. The first dash game, if you will. There is no clear conclusion to the part, the action instead "jump cuts" to the second part.

 Ironically, the spiders' best weapon contributes to their demise. 
The second part has Horace crossing a chasm, hanging from threads that descend from live spiders. Gripping stuff. The third part, however, "references" Space panic: Horace climbs the spiders web and stuffs the spiders into holes he has created by stomping with those two enormous feet of his. I've felt this is one of the best parts in any Horace game ever, but it was damn hard to get here, as the first two parts can be frustratingly annoying. In a way the format established in 'Skiing is also used here: the game rewards good gameplay with a better, more interesting game, which is also less stressful than the lead-in parts.

Although the instructions again stress that Horace does not die, but merely has to give up the hunt after all his "serum" has been lost, the game is hardly non-violent. Horace is set out to kill the spiders, stomping them with glee. So the Horace trilogy also represents an deepening spiral of revenge and retribution. Previously, the world was intent on squashing Horace, now it's payback time. One gazes into the abyss and so on.

The heart of darkness: the web thickens...

I do not think much of Hungry Horace, as the game goes nowhere, but the two later Horace games are pretty cool what with the multi-part structure. The combination of two different genres creates a surprisingly fresh and original atmosphere, almost like playing two different games in quick succession and pretending they belong together. The consistent graphic styling make nice use of the Spectrum platform, using the graphical limitations of the computer to convey a suitable abstraction rather than trying too hard for naturalism. The cohesion of the trilogy, both thematically and in appearance, contributes to a mysterious atmosphere that begins from the naive scenario of Hungry Horace and ultimately descends into the dark violent nightmare that is the final screen of Horace and the Spiders.

Sunday 13 January 2013

Work in progress: Spectrumvideo 48k

The 48K Spectra. Or the Spectrum-Video ZXSVI748

I happen to have a Spectravideo MSX 728 in poor condition and as it is unlikely to have any other future, I wanted to try to use its keyboard for some project. My thoughts went naturally to the ZX Spectrum. First I toyed with the idea of building a new case entirely, but pretty soon I was positioning a rubber-key Spectrum motherboard inside the Spectravideo case. 

The 728 case is huge, so it's not a big challenge to fit the board inside. I was pleasantly surprised to find out that the openings for connectors are already in very useful positions. 

Trying the motherboard for size, before removing the screw holder.

Only one screw holder has to be removed and something needs to be done to the power supply connector. The question at the moment is if all important peripherals work, despite the good fit. An Interface II type flat peripheral poses no problems. The vertical modules may be a bit more difficult, as they collide with the backside of the computer. At least I'd like to connect the Divide 2k11 to the finished computer.

Looking from behind: 9V, Peripheral connector, tape connectors, TV out.

The Spectravideo keyboard unit.

The SVI keyboard is a removable unit with a straightforward matrix-type connectors. The matrix wiring is very convoluted and it's not really possible to salvage any of the existing lines, so the simplest thing to do was to severe all connections between the keys and create new lines.

The existing connections are destroyed by sawing between all the key positions.
As can be seen, this is not yet the full treatment.

Again, I am torturing my woodworking saws: The result is ugly, but it works. It also feels like the most disrespectful thing I've ever done to someone else's design.

Another option might have been to do a new circuit board, which would have been a first for me. As the board is quite big and would have to perform well against wear in a mechanical/electrical role, I did not want to try such a thing as my first board project.

The ZX Spectrum membrane connections are first drawn for reference.

The most gruelling task is putting the new connections in place. The only way for doing this I could come up with was to join each connector with a small wire, trailing from hole to hole. After drilling two small holes next to each of the connectors, the wires could be then be laid underside the board. (I used a 1,5mm metal drill.) The wires are pulled to the topside, where they are soldered to the key connections. Each of the keys is connected twice, for the matrix columns and rows. 

Between the circuit board and the plastic keys there is the rubber mat
that holds the conducting pegs.

I now have the normal Spectrum keys working. The keyboard is connected and in place. The keyboard works very well with the Spectrum, and it is certainly nicer than the rubber keys or the Spectrum+ keyboard. The contacts work well even if I'm not a very experienced in soldering. There is enough leeway in the rubber "domes" underside the keys, so it does not matter that the soldering is a bit lumpy. This in mind I'd say the SVI keyboard is very good for this kind of mod. 

Testing the keyboard connections.

The neat things are yet to come. Now that I have the essentials working, I can start thinking how to wire all the SVI special keys and what they might do in the Spectrum context. To get keys like comma and period working directly on the Spectrum, I have to connect them both to the symbol shift and the relevant key at the same time. 

There's also plenty of room inside the case, so that's another possibility for some creative uses. I'm also thinking that the ZX Evolution board could go very nicely inside the SVI case.

Edit: A word of warning! I have suggested that building keyboard combinations (Backspace, cursor keys, etc.) would be a simple matter of connecting the key to the relevant inputs on the motherboard. However, it does not seem to be quite as straightforward. The Spectrum+ and Spectrum 128 keyboards, which have these kind of combinations, use a three-layered keyboard membrane. The functions of the membrane are not easy to replicate with wires. I may have ruined the ULA chip of my Spectrum by messing around with a poorly built "Delete" key circuit, although the cause is not absolutely certain. I need to learn more before I can suggest a solution, that is, if it is possible at all - the Spectrum+/128 solution is mechanical. I still think it should be pretty safe to create the normal Spectrum keyboard circuit, as I have shown above, without any combination keys. Of course, in any case it makes sense to turn off the machine when inserting the connectors.