I'm not sure what the correct term for creating a functional equivalent of an obsolete machine is. It's a bit like the process used in the movie Jurassic Park: extracting the essential instructions for creating a long-dead machine then substituting the irreplaceable stuff with equivalents.
That movie carried the message that it was wrong to bring back the dead, and that there were some things that should be left alone. Is it wrong for us to do this? There are differences of course: new machines have improved performance, which is like creating a T-Rex that runs a hundred times faster, smarter, smaller and cheaper. But in the best tradition of B-movie mad scientists, let's ignore the warnings and have a look.
In considering cloning old machines, it is worth taking a look at a group of them to see what they have in common to see where hardware and software (HDL) modules can be re-used.
Glue Logic
This is of course unique to each machine, and is
the first thing that needs to be put in the FPGA.
Reset
A proper reset-chip like the MAX691 would be a
good generic solution.
An active-low reset is the better choice, and most common.
Clock
A proper oscillator module is the simplest and
most reliable solution. The B5 has a header-programmable
oscillator, so all individual machines need do is set these
headers.
CPU
There were a limited number of CPUs used,
primarily the 6502 and Z80.
Generally in 40-pin chips, A0-15, D0-7, GND and VCC ensure 26 of
those 40 are common to all machines. That leaves 14 CPU-specific
signal pins to deal with.
Memory
RAM
Much bigger RAM chips are available today so it should be easy to provide.
Static RAM can provide 256K easily, dynamic RAM many megabytes.
ROM
A large Flash ROM should be suitable replacement for all previous ROMs.
Alternatively, if the system is only to be used occasionally and be reconfigured, then battery-backed CMOS RAM may be suitable.
AudioVideo
Providing video was the most technical aspect,
unique to each machine. Some machines did this in a single chip
(e.g. ANTIC in the Atari 800XL)
Video
All machines had some video output.TV output
Old micros generally interfaced to TVs.UHF TV output
Old micros generally interfaced to old TVs with UHF input. This required a lot of circuitry to produce a UHF carrier modulated by a composite video signal.Composite video output
This is better than UHF, because it removes the UHF modulator from the signal path.S-Video output
This is better than colour composite video, because it keeps the brightness and colour signals seperate.SCART TV output
This is the best TV interface because it allows the transport of composite stereo audio, video, s-video, or RGB video directly. Thus clones can discard the complicated circuits required to produce the modulated TV signals, and simply output the audio and RGB signals directly to a SCART socket.Monitors
Old micros sometimes used monitors with many incompatible signals and connectors. It is becoming vanishingly rare to find non-PC monitors, so if at all possible a clone should try to be capable of producing a PC-compatible video signal.Audio
This varied from single toggled bit to quite complex sound generators.Phono sockets
Audio signals can also be sent to phono-connectors, and thence to your hi-fi amplifier for seriously loud sound effects (instead of the tiny speakers on the originals!).
I/O
Often the chips were only used for simple I/O, up
to 3 ports, so making it very easy to produce equivalents.
System I/O
All machine required this for a keyboard and tape interface, the absolute minimum required.Keyboard
These varied between machines, so it would be better to replace them all with a PC keyboard and translate scan codes to a virtual key-matrix. Otherwise you'll need a new keyboard for each clone.PS/2 Keyboard Interface (VHDL)
This turns the serial keyboard data into a parallel-output scan code.Scan-code to virtual matrix (VHDL)
This uses the scan code to set/clear bits in an emulated keyboard matrix.Tape Interface
These varied between machines. Given that the internet is the only practical way of getting software for old micros, it might be best to have the PC send digital data direct to the I/O bits and avoid the analogue signal conditioning.
However if you do wish to save/load on tape (or most likely just read old tapes for saving to the PC), then a good-quality tape machine should be used, and these mostly use phono sockets.Tape Out
This is the easier task.Tape In
This is the harder task, because tape playback introduces wow-and-flutter.Serial I/O (not on all machines)
If an old micro had no standard serial chips, a PC support logic chip (e.g. the 16C552) will provide PC-compatible serial ports. These have plenty of documentation and source code.Serial port buffers are required to drive RS232 signals, and Maxim have an RS232 chip that will drive all PC-compatible signals and require only a 5V supply. It does this by on-chip charge pumps and external capacitors. One of these chips will be needed for each serial port.
The PC's 9-pin D-type connector pinout provides a common standard replacement for the many incompatible connectors of old micros.
Printer I/O (not on all machines)
Printer ports have to drive signals to the real-world via relatively long cable, and would probably benefit by being buffered through more robust chips (LS TTL). If so, these chips can provide the necessary latches too, and the bulk of the interface implemenented in TTL just as the original PC LPT port was. Some PC support logic chips (e.g. the 16C552) are capable of driving the signals directly.The PC's 26-pin D-type connector pinout provides a common standard replacement.
Though you will have to check whether your fancy laser printer will cope with simple ASCII.User I/O (not on all machines)
The Acorn Atom and BBC micro had these, and intended them to be used by hobbyists, but few others machines invited such amateur tinkering. Most modern projects requiring a bit of parallel I/O use the PC printer port.
Floppy Disk
This was generally a luxury, and the popularity of the PC has meant that FDC chips have vanished into PC integrated chipsets. Given the variety and complexity of interfaces, it may not be worth the effort of producing them for the benefit of reading what few old disks remain.Hard Disk
This is even rarer than the Floppy disk, and with similar problems.
On the positive side, it is relatively simple to produce the interface hardware for modern IDE drives. This will require the HDD software to be re-written for old machines but this is not as difficult as emulating old HDD interface hardware.
The software to run on these old machines has long since ceased to be available commercially, and is only available from web sites. So anyone wishing to clone an old micro is going to have a PC to get software, and indeed read about how to do it in the first place. So we can assume clones will not be far from a PC.
One can also assume that clones are mainly for the pleasure of reproducing an old micro and playing the odd game on it until you get bored and return to your PlayStation. It's unlikely that you will want to do lots of word-processing, spreadsheets, save files etc
So it might be practical for the PC to perform the duties of loading/saving code. The PC could emulate the tape/FDD/HDD storage device, and this has been done before by the Atari Periheral Emulator. A faster but more complex alternative is for the register of the cloned micro's storage device interface chips to be implemented as dual-port RAM with the PC operating the 'other side' to emulate the behaviour of those old chips. Since it is not simple or convenient to plug a clone into the PCI bus, the PC could operate its side of the DPRAM registers via the LPT interface.
The PC might act both as a disk drive and a printer, using the same cable.
At some point you may wish to operate a cloned micro away from the PC, and so need some form of transferable storage media. IDE drives are one choice. For media as robust to shocks as a floppy, some kind of solid-state media such as PCMCIA/Compact Flash, or SmartMedia would be better. These might also replace the proprietary ROM cartridges of old machines.
| CPU | MHz | VID | KBD | I/O | SER | AUD | FDC | Other | Name |
| Z80 | 3.250 | TTL | TTL | none | none | none | ZX80 | ||
| Z80 | 3.250 | ULA | ULA | none | none | none | ZX81 | ||
| Z80 | 3.250 | TTL | TTL | none | none | none | Ace | ||
| Z80 | 1.777 | TTL | TTL | LPT | 1602 | none | 1771 1792 |
TRS80 / LNW80 | |
| Z80 | 3.250 | ULA | ULA | none | none | AY3-8910 | none | Spectrum | |
| Z80 | Nascom | ||||||||
| Z80 | Lynx | ||||||||
| Z80 | Elan | ||||||||
| 6502 | UK101 | ||||||||
| 6502 | 6522 | 6551 | Elekterm | ||||||
| 6502 | 1 | 6847 | 8255 | 6522 | none | 8271 | Atom | ||
| 6502 | 2 | 6845/5050 | 6522 | 6522 | 6850 | 8271 | BBC | ||
| 6502 | ULA | 6522 | ORIC | ||||||
| 6502 | 1.774 | ANTIC | POKEY | none | ??? | ??? | Atari 800XL | ||
| 6502 | VIC | VIC20 | |||||||
| 6510 | 6566 | 6526 | 6581 | C64 | |||||
| 6809 | 0.894 | 6821 | CoCo | ||||||
| 6809 | 0.894? | 6821 | Dragon32 | ||||||
| 6809 | 0.894? | 6821 | 6551 | Dragon64 | |||||
| 6309 | 0.894 | MC10 | |||||||
| 68000 | 8 | SHIFTER | 68901, 6850 | YM2149F | 1772A | MMU, DMA | Atari ST | ||
These are useful to know because designs often saved the cost of the CPU crystal by deriving timing from the video crystal. Video crystal frequencies for PAL and NTSC have obscure origins, so here are the precise values.
NTSC deriviations
14,318,181.81 Base x 4. Used in original PC. NTSC master crystal. 7,159,190.90 Base x 2 3,579,545.45 Base = NTSC TV colour subcarrier. NTSC master crystal / 4 ? 1.789,772.72 E.g. NTSC Atari 8-bit CPU 894,886.36 E.g. NTSC CoCo
Tolerances: NTSC 3.579545 MHz +/- 10 Hz.
The NTSC color subcarrier frequency was chosen to be 35/44 * 4.5 MHz = 3.5795454545... MHz. To suppress visibility of the color subcarrier in the monochrome information, "frequency interleaving" of the color and monochrome sidebands was done. This required the horizontal scanning rate to be a non-integral fraction of the color subcarrier; 1/227.5 x 3.5795454545 MHz = 15734.26573... Hz was chosen, close to the original black-and-white rate of 15750 Hz. This dropped the frame rate to 29.97003 Hz. In the digital audio format, 35 lines in each frame are allocated to vertical sync and overhead, leaving 490 lines/frame for audio data. 490 * 29.97 * 3 = 44055.9 Hz.
PAL derivations
17,734,475.00 Base x 4. PAL master crystal. 8,867,237.50 Base x 2 4,433,618.75 Base = PAL TV colour subcarrier. PAL master crystal / 4 1,773,447.50 PAL master crystal / 10
Tolerances: PAL 4.43361875 MHz +/- 5 Hz.
14,187,576.00 Atari crystal Y1 in my machine.
This is the crystal nearest the memory controller chip.
This is 3.2 times the PAL colour subcarrier.
There is another crystal Y2, of unmarked frequency.
Baud rate generation:
14,745,600.00 Base x8 11,059,200.00 Base x6 7,372,800.00 Base x4 3,686,400.00 Base x2 1,843,200.00 Base
Others:
6,500,000.00 Sinclair machine ceramic resonator frequency 3,250,000.00 Sinclair machine CPU clock 1,777,777.77 LNW80 CPU clock = 16MHz / 9
| CPU | ||
| Z80 | Common micro | |
| 6502 | Common micro | |
| 6510 | Enhanced 6502, used in C64 and BBC micro. | |
| 6809 | Has on-chip crystal oscillator for driving the clock. | |
| 6809E | As above but with external clock drive for E and Q. | |
| 6309 | Superior replacement for 6809 | |
| 68000 | ||
| Video | ||
| 6845 | CRTC | A common video memory controller |
| 6847 | VDG | Has integrated font ROM |
| 5050 | Teletext display chip, used in Acorn 8-bit machines. | |
| 6566 | VIC | Used by C64 |
| Audio | ||
| AY3-8910 | PSG | Includes 2 I/O ports. 40 pins. AY chips no longer made by GI (General Instrument) or anyone else. GI became Arizona Microchip. |
| AY3-8912 | PSG | As above but with one I/O port, to fit in 28-pin package. |
| YM2149F | PSG | YM2149F is like AY3-8910 but not 100% compatible. Also found in russian Spectrum clones |
| YM2203 | PSG | Compatible with the GI chips, but includes support for FM synthesis via a DAC |
| 6581 | SID | Sound Interface Device. Used by C64 |
| Parallel I/O | ||
| 8255 | PIA | Simple yet popular chip, could do elementary handshaking in hardware. |
| 6522 | VIA | Very versatile chip, has timers and shift registers too. |
| 6526 | CIA | Has timers. Used by C64 |
| Mixed I/O | ||
| 68901 | MFP | Multi-Function Peripheral, both parallel and serial I/O. |
| Serial I/O | ||
| 6850 | UART | Required external baud-rate generator. Often used for synchronous comms. |
| 6551 | ACIA | Internal baud-rate generator included. |
| FDC | ||
| 8271 | FDC | |
| 1771 | FDC | Single density controller |
| 1772 | FDC | Double density controller |
| uA365 | FDC | PC-compatible chip |
| Misc | ||
| 6883 | SAM | Synchronous address multiplexer, and memory map decoder. |