The Spectrum (and related things) Page

This page has been moved to zx/. You should be redirected automatically.
NEW: The ZX128 Page - DIY upgrading from 48k to 128k!

Unpopulated CS-DISK PCB


It seems nobody remembers the CS-DISK anymore, so I have decided to create a little corner on the web about that brilliant piece of hardware in particular and the Sinclair ZX Spectrum in general. If you have anything to add, ask about or correct, please let me know. I will try to add to these pages (splitting this one is of course required to make it "them") on a regular basis, but the more comments I get the more incentive I have...


Introduction

The CS-DISK was manufactured by the Danish company Circuit Design in 1985. It was able to control 4 standard double-density floppy drives as well as equipping the Spectrum with CP/M-compatibility. Furthermore it contained a Centronics printer interface, an interface for an IBM PC keyboard (which iirc only worked in CP/M) and a socket for an EPROM that would replace your Spectrum ROM completely if you wanted.

I seem to recall that the interface could be bought as an assembled unit too (I got mine as a as a DIY kit). However, I can't remember the price of it now; the ads are in some box in the attic.

A user group later built some expansion kits for use with the CS-DISK, namely a replacement for the IBM keyboard interface that allowed most of the circuitry to be re-used as a Kempston joystick interface instead, and, more importantly a RAM back-switcher that allowed you to run CP/M 2.2 with 56k free for programs. Both of those expansions were, I believe, only available as DIY kits.

The interface featured a Western Digital WD2797 floppy controller and a lot of standard TTL components as well as a PEEL for ROM address decoding and an EPROM with the CP/M that partly overlaid the BASIC ROM address space. Formatting, copying and so on was done with CP/M programs.

You were able to write Spectrum programs that made use of the CP/M system calls for disk access, and of course you could reprogram the disk controller. I managed to exchange files with an Amstrad Joyce via a CPC6128 (just used for transferring data between the Amstrad 3" disks and something the rest of the world could use), and with a PC, and then there was the Mandelzoom program that played back an animation with four frames per second directly from a floppy. Those were the days! <sigh>

I spent months disassembling and commenting the CP/M ROM (named SDOS by Circuit Design, just as they called the operating system SP/M) armed with the bible (the Complete Spectrum ROM Disassembly) and a list of CP/M functions, and I learned a lot in the process. Unfortunately, my disassembly is on several hundred (estimated) pages of paper with all my comments written on them, so I am not going to put that up for download any day soon... However, rumour has it that a commented copy of the source code exists somewhere. Anyone?


How the...?

As everyone knows, the main CP/M system entry point is at RAM address 5, which is occupied by the Spectrum BASIC ROM. Further, CP/M programs are located from address 100h, which is also very much ROM on a Spectrum.

The solution to this obvious problem which has made everybody think that there can be no CP/M on a "normal" Spectrum, is as simple as it is brilliant: On the interface is a latch that switches the ROM out and replaces it by the upper 32k of RAM by pulling the address line A15 high. The CPU knows nothing about this, but the effect is that any request for an address between 0 and 32k lands 32k higher, effectively enabling a program previously located at address 32k+5 in RAM to run as if it had been located at address 5. The same technique enables the floppy controller to use interrupts for signalling, resulting in a very fast disk system. Normally an unused bit of the Spectrum ROM is replaced by a piece of code that activates the disk system, whereafter some RAM below the BASIC program space is reserved for disk buffers and the like - just as it is with a microdrive.

The ROM on the interface was switched in at a few places beside the main entry point, most notably replacing the built-in COPY command so that it worked with an EPSON compatible printer.

The thing took almost weeks to assemble, but since we were a couple of friends who built some together, we managed to get them together eventually...
On the positive side, it kept us away from school (nah, just kidding ;-)


Usage

Initializing the disk system is done with the command
RANDOMIZE USR 15360
After initializing, your contact to the disk system went through #4, like these examples:
PRINT #4: SAVE "a:test.bas"
PRINT #4: LOAD "sabre.scr" SCREEN$
and the easy use of CP/M commands and programs:
PRINT #4;"dir a:*.bas"
PRINT #4;"era a:*.cod"
PRINT #4;"format B:80DS"
FORMAT is a CP/M program so it has to be on the floppy for the last command to work. The really interesting part was
PRINT #4;""
which left you in CP/M at the good old A> prompt until you pressed BREAK.

To use CP/M programs like FORMAT (and to enter CP/M like in the last example above), you had to make the upper 32k of RAM available to the CP/M system by CLEAR'ing 32767.

I am planning to add a scan of the manual (only in Danish, unfortunately) and perhaps a more in-depht explanation of the way this interface worked later, but for now let's just enjoy a few pictures, shall we? ;-) Oh yes, I managed to scan the diagram for now (note that the file size is nearly a megabyte...)



Let's start at the beginning...

Back in the good old days in the middle of the eighties there wasn't really a standard defining what a home computer should contain. The market was filled with different brands and models, of which a small number were "big", and you would energetically defend your own brand as being the only real computer - religious wars with a twinkle.

I myself was the proud owner of a Sinclair ZX Spectrum, which had several advantages. Apart from being easy to program, it looked different than a "normal computer" and was simply the best! It was also one of the best selling home computers totally (and it is said to be produced in various clone models even today in the year 2000) and together with its predecessors, the ZX80 and ZX81, it was one of the few models to really make home computing affordable for everyone. One of the tings that made the Spectrum so special was the fact that you could get an incredible lot of expansion hardware for it, and you could buy DIY kits for anything. Compared to other home computers of the time, the Spectrum was a bit more "serious" - I would dare to say that larger percentage of Spectrum owners than, say, Commodore 64 owners, used their computer for learning. This is not least due to the fact that the Spectrum had a well developed programming language built-in, including easy-to-use commands for controlling sound (what little it was capable of, anyway) and graphics.

During the last half of the eighties we were many who expanded our Spectrums with home-built hardware in more or less elegant ways. Even today I have my "main" Spectrum built into a PC case with switch mode PSU, double floppy drive and a lot of extras that you probably need to be from that era to be able to see the point of.


This page is dedicated to nostalgia!



All facts are written down more or less as I recall them from memory almost a decade after switching to the PC as my main computer. As I wrote earlier, if you find any errors I'd like to know.

First of all I would like to point out that my favourite Spectrum keyboard is the good old rubber one. Unfortunately all my keyboard membranes broke down, and when I took these pictures the only working keyboard I had was a Spectrum+. It too has since broken, but after a long search I was able to get some spares from The Trade In Post. No new pictures yet, though...

As I said, my Spectrum is built into a PC case today. It started as a lot of bits and pieces spread loosely around the table with ribbon cables between them, until it was built into a case from an old stereo, one of my father's friends gave to me. In '89 I bought a PC case at a German mail order company and moved everyting into that instead. At that time I was already in the process of switching to the PC (I had worked with PC's since '85) so I didn't use much time getting it to look nice.

This kind of computer was in some circles called an armour-Spectrum. The story has something to do with a guy from a computer club who went to a smith and asked for a robust casing for his Spectrum - and got it... I haven't seen that particular Spectrum myself, but the name stuck.




An overview of my Speccy system. The big thing in the lower left is a switch mode power supply. Until I added that, the system would crash when someone just thought about opening the fridge and things like that. The hardware draws too much current for the built-in regulators (on the Speccy and on the CS-DISK). In some ways you could say I was prepared for the wonders of Windows at an early age...



My custom-made startup menu. AUTO.BAS was a common name for menu programs on CS-DISK floppies, and BOOT.BAS was used to boot the special 56k CP/M 2.2.



A front view of the complete system. The switches control assorted functions such as enabling or disabling MEMRQ and IORQ to the CS-DISK, enabling the SpecDrum simulator (which makes silly sounds whenever the disk I/O-system is paged in and out, causing it to sound like a paranoid Geiger counter when the floppies are active) and activating the replacement ROM on the CS-DISK.



The Speccy itself, containing a keyboard signal amplifier and a RAM switching circuit for the 56k CP/M. The 32k RAM circuits are replaced by 64k models to support switching and the onboard power regulators have been removed.



A SpecDrum simulator (left) and an AY3-8910 synth, modified for 128k sound compatibility (as far as I recall, Into The Eagle's Nest, among others, would play fine on a 48k Speccy too). This thing was actually a construction project in a Danish electronics magazine years before Sinclair thought about using the AY3 in the 128k Spectrum. When the 128k came out all I had to change was the port address and the oscillator frequency.

The SpecDrum was in essence just an 8-bit D-A converter, capable of playing samples with an impressive sound quality. Unfortunately it shares the I/O-addresses of some of the CS-DISK's paging hardware, so that it (or the speaker) has to be turned off while the disks are working.



The CS-DISK interface, probably my most important piece of hardware. The Issue 1-lookalike patch in the upper left corner is a replacement for the PEEL circuit that decoded the addresses where the interface EPROM replaced the Spectrom ROM. The PEEL is a custom-programmable logic chip, but since I had no description of it, I had to sit down with the interface diagram and think real hard for some time when it suddenly died.

Yes, I know that removing all the wires that weren't connected wasn't neccessarily the brightest idea I ever had, but hey, I was only around fifteen at the time.



A CP/M directory listing. The improved 56k system uses a 64 character screen similar to that of Tasword II.



"Spræng Skolen" (Blow The School), a game I wrote once. You had to rescue pupils from the buildings and place dynamite in different places before blowing the thing.

Kids: Don't try that at home!
Or in school...



A screenshot from my Mandelzoom program - it stores 80 frames of 4k (2/3 of the screen, no colour) each on a floppy and replays them at four frames per second. Took some hours to calculate first, though.
In those days I was dreaming about networking Spectrums to add the computing power together. Never got around to it, though.



An NMI debouncer (left) and a simple LM386-based amplifier.



Another Mandelbrot image.



When I started this page, I just wanted to draw the world's attention to the fact that CP/M is in fact possible, and has been done, on a 48k Spectrum, despite most people claiming it to be impossible over in comp.sys.sinclair. Yet another advantage of the Spectrum over the C64! ;-)

As I digged through my notes, I discovered a lot of other tings, all bringing back fond memories that I would like to share with you, so in time I'll definitely add something about the RAM switching extension for the 56k CP/M, and some of my own things, such as my parallel ROM project, the 128k modification, my modified ROM with Epson-compatible graphics hardcopy routine, 10 times faster CIRCLE command (ok, I found that one in a drawing program and modified it), the "network" that enabled me to exchange files with an Amstrad and other strange things I made with my Spectrum during those ten years I was actively using it. Curious? Let me know!


Final thoughts...

If you've made it to this point, I suspect you have at some time in your life known the same joys of having a Spectrum invade your life and amazing you with its capability of doing so many new things that you hadn't known to be possible before. In short: Having been there when the personal computer revolution really started!

If you were there at the time, you know what I mean. These pages are for you!

I'm not finished so come back soon...

*Perhaps even of finally understanding the puzzling way the ZX80 hardware worked?The ZX80 was quite simple yet used some clever techniques to control the display. Among other things, it actually fools the CPU into addressing the characters, saving some hardware costs (and making the screen go away if the CPU has other things to do). Still, it provided me with a good understanding of some fundamental concepts of computer hardware.
Ever wondered why NEWLINE was character 118? There was a good reason, closely tied to the fact that the ZX80 screen RAM could shrink if the lines were not full of text!

** If you should be happening to be a C64-owner browsing past, don't flame. As we all knew even then, it was just fun! ;-)


Well, that's it for now. Home? Comments? Last update 2001-07-18