SAM Coupé
The SAM Coupé is an 8-bit British home computer that was first released in late 1989. It was designed to have compatibility with the Sinclair ZX Spectrum, albeit in 48K mode only. It features a compatible screen mode and emulated compatibility, and was marketed as a logical upgrade from the Spectrum. It was originally manufactured by Miles Gordon Technology, based in Swansea in the United Kingdom.
Released at a time when 16-bit home computers were more prevalent and a lack of commercial software titles led to it being a commercial failure, yet it had an active community of disk magazines and hobbyist coders.
Hardware
The SAM Coupé's hardware was designed by Bruce Gordon of Miles Gordon Technology. The computer included custom silicon to handle display, memory and IO functionality. This was originally prototyped using wire-wrapped 7400-series logic chips, before being produced as a VLSI VGT-200 gate array ASIC.Processor and logic
The machine is based around a Z80B CPU clocked at 6 MHz and a 10,000-gate ASIC. The ASIC performs a similar role in the computer to the ULA in the ZX Spectrum. The Z80B CPU accesses selected parts of the large memory space in its 64 KB address space by slicing it into 16 KB banks and using I/O registers to select the memory pages mapped into each 16 KB bank.Memory and storage
The basic SAM Coupé model has 256 KiB of RAM, internally upgradable to 512 KiB via a connector on the main board accessible via a trapdoor underneath, and externally up to an additional 4 MiB, added in 1 MiB packs via the "Euroconnector" on the back of the system.The computer has a direct connection for a cassette recorder for data storage but two 3.5 inch floppy disk drives can be installed within the case as well or externally using an interface.
Graphics
The SAM Coupé was designed primarily for the UK market, and is designed around the PAL television standard, which refreshes at 50 frames per second. Unlike a standard PAL signal which is interleaved, the SAM is designed to emit two identically positioned fields at 50FPS, giving something closer to a 312P signal than the 625I broadcast television signals common in the UK at the time.The display is surrounded by a large border area to provide a title-safe display zone for the CRT televisions of that era. The colour of this region can be changed in software by using the BORDER port to select a colour from the palette.
The SAM Coupé has four display modes:
- Mode 4 — 256×192, linear framebuffer, 4 bits per pixel = 24 KB
- Mode 3 — 512×192, linear framebuffer, 2 bits per pixel = 24 KB
- Mode 2 — 256×192, linear framebuffer, 1 bit per pixel with separate colour attributes for each 8-wide block of pixels = 12 KB
- Mode 1 — 256×192, non-linear framebuffer, 1 bit per pixel with separate colour attributes for each 8×8 block of pixels = 6.75 KB
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
Flash | Bright | Paper 2 | Paper 1 | Paper 0 | Ink 2 | Ink 1 | Ink 0 |
All modes use palette-based Colour look-up tables, selecting from a palette of 128 colours. The palette values consist of 2 bits for each of the red, green and blue components as well as an extra bit which increases the intensity of all three components by a half-step.
Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
- | Green 1 | Red 1 | Blue 1 | Half-Bright | Green 0 | Red 0 | Blue 0 |
The ASIC can be configured to generate interrupts when a line on the display is starting to be emitted, allowing video effects to be synchronised with specific display lines with little effort. By default, it will generate an interrupt for every frame. Typically this interrupt is used to double buffer the frame, read the keyboard/mouse state, and output music.
The interrupt state can also be polled directly from the ASIC's status register.
The Motorola MC1377P RGB to PAL/NTSC video encoder creates a composite video signal from the machine's RGB- and Sync-signals for the RF modulator.
The non-standard SCART display connector includes both composite and RGB output, as well as signals to drive a 16-colour TTL monitor.
Access to internal RAM was shared between the display and the CPU, with CPU accesses incurring a speed penalty as it was forced to waited for isochronous ASIC memory-accesses to complete. As a result, the SAM Coupé's CPU effectively ran only around 14% faster than the ZX Spectrum CPU, yet was required to do much more work in SAM's high-resolution modes to produce a similar movement on the display. A Mode 3 or Mode 4 screen uses four times as much RAM as a ZX Spectrum Mode 1 display, so four times the work had to be done in the same time when updating it.
A small compensation was the straightforward arrangement of colour pixels in this memory, instead of the ZX Spectrum's more limited display and attributes memory. Low-level graphics software operations could be much simpler than their Spectrum equivalents and therefore somewhat faster to execute.
The penalty of memory contention delay applied to all memory accesses to RAM, and not just to memory associated with the video circuitry. Hardware sprites and scrolling would have greatly improved the performance of games, unfortunately there was insufficient wafer space on the VLSI ASIC to include such circuitry.
While the main 256×192 area of the screen was being drawn, the processor could only access memory in 1 out of every 8 t-states. During the border area this was 1 out of every 4 t-states, which had no effect on the many instructions whose timings were a multiple of 4. In modes 3 and 4 the display could be disabled completely, eliminating these memory contention delays for a full 6 MHz running speed. Code running in ROM or external RAM was unaffected by contention, though any RAM accesses they performed to shared internal RAM would still be affected.
Audio
Six channels of 8-octave stereo sound are provided by a Philips SAA1099 sound generator chip.This sound chip can also produce two 4-bit sampled sound channel, and generate noise.
To provide backwards compatibility with the ZX Spectrum, the SAM also provides a single-bit 'beeper' channel which can be used to emit simple tones by toggling the bit on and off as per the original Spectrum.
Backwards compatibility
In order to match the processing speed of the ZX Spectrum, the SAM Coupé introduces extra wait states in display mode 1 to slow down the CPU to roughly match the rate of that system.Firmware and DOS
The machine shipped with 32 KB of ROM containing code to boot the machine and a BASIC interpreter written by Andrew Wright and heavily influenced by his earlier Beta BASIC for the ZX Spectrum. The ROMs contained only the bootstrap code and the DOS was instead loaded from disk using the BOOT command, or the F9 key. The majority of disks shipped with SAMDOS, the system's first DOS, on them so that they could be directly booted. An improved replacement, MasterDOS, was also developed offering faster disk access, more files and support for the real-time clock accessory to provide file timestamps amongst many other improvements.The BASIC was very advanced and included code for sprite drawing and basic vector shapes such as lines and circles. The screen co-ordinate system for these was variable and could be arbitrarily scaled and centred. A provision for "recording" sequences of graphics commands so that they could later be repeated without the speed penalty of a BASIC interpreter in between was provided.
The machine is capable of running CP/M 2.2 using the Pro-Dos software with support for both 720 Kilobyte format disks and IDE drives
Disk drives
The SAM originally used Citizen 3.5 inch slimline drives which slotted in below the keyboard to provide front-facing slots. Like IDE hard disks, these enclosures contained not just the drives but also the drive controllers, a WD1772-02, with the effect that the SAM could use both drives simultaneously.Due to a flaw in the Coupé's design, resetting the machine while a disk was left in a drive would be liable to cause data corruption on that disk, as while RESET is held in, no 8Mhz clock signal is sent to the drive's controllers.
The double density disks used a format of 2 sides, 80 tracks per side and 10 sectors per track, with 512 bytes per sector. This gave a total capacity of 800 KB, though the standard directory occupied 20 KB leaving 780 KB free for user files. Files were stored in the same structure as MGT's original +D interface, but with additional codes used for SAM Coupé file types. The disk encoding, encoding strategy, and track and sector header formats were compatible with those used on the IBM PC and Atari ST, and programs were available to read FAT formatted disks.
Expansion ports
A large array of expansion ports were provided, including:- Two internal drive bays.
- Non-standard SCART connector offering composite video and digital and linear RGB as well as power input.
- 64-pin Euroconnector for general purpose hardware expansions.
- Mouse socket.
- Light pen / Light gun and Stereo sound output via 5-pin DIN connector.
- MIDI IN/OUT ports.
- Network using the MIDI port.
- Atari-style 9-pin joystick port.
- 3.5 mm mono Cassette jack.
Power
The SAM's Power Supply was a modified Amstrad CPC unit, with the RF modulator built in and connected via a joint power/TV socket to the computer. This made signal interference from the AC/DC converter common and it was a popular but entirely unofficial modification to remove the modulator and keep it as a separate unit.Naming
The capitalised SAM is an acronym for 'Some Amazing Micro' according to Alan Miles also the ‘Coupé’ was a nickname from two sources: one being an ice cream sundae called the “Ice Cream Coupé” and the other because the machine resembles a fastback car in profile with the feet as the wheels.ZX Spectrum compatibility
Emulation of the ZX Spectrum was limited to the 48K and was achieved by either using a supplied utility and a skeleton ROM image or by loading a complete copy of the ZX Spectrum ROM and switching to display MODE 1, which mimicked the ZX Spectrum display mode and approximated that machine's processor speed.The 128K model's memory map was incompatible with the Coupé's memory model and the machine featured an entirely different sound generator. It was possible to convert games and demos by hacking the 128K code.
Because the Coupé did not run at exactly the same speed as the Spectrum even in emulation mode, many anti-piracy tape loaders would not work on the Coupé hardware. This led to the development by MGT of a special hardware interface called the Messenger which could capture the state of a connected ZX Spectrum to SAM Coupé disk for playback later without the Spectrum connected. The Messenger plugged into the Coupé's network port, and the Spectrum's expansion slot. Due to unsuitable onboard break buttons, a de-bounced break-button card was also provided, which plugged into the Coupé's expansion slot.