Shadow RAM (Acorn)


Shadow RAM, on the Acorn BBC Micro, Master-series and Acorn Electron microcomputers is the name given to a special framebuffer implementation to free up main memory for use by program code and data. Some implementations of shadow RAM also permit double-buffered graphics.

Background

The BBC Micro, Master-series and Electron machines use the 8-bit 6502 and 65C102 processors with a 16-bit address space. This address space is split into 32 KB RAM, 16 KB sideways "paged" address space and 16 KB operating system space. Video or screen memory is typically allocated from downwards as necessary, occupying as little as 1 KB for Teletext mode 7, or as much as 20 KB for modes 0-2. Thus, screen memory can therefore occupy a considerable amount of the available directly-addressed 32 KB RAM.

Overview

Shadow RAM is a block of RAM that can be considered to reside in parallel to the normal memory map and is accessed by the system only under certain conditions. When shadow RAM is enabled, the memory region normally used for screen memory becomes available for BASIC program use and for applications employing officially documented operating system interfaces. Given the maximum requirement of 20 KB for screen memory with the systems concerned, this amount of RAM is provided as shadow RAM.
Shadow RAM was fitted as standard on the BBC Micro Model B+ and on the BBC Master series, but was an optional feature provided by third-party expansions on earlier BBC Micro systems and the Acorn Electron. The Aries-B20 product, initially sold by Cambridge Computer Consultants, offered 20 KB shadow RAM for the BBC Model B, transparently diverting non-framebuffer accesses to the shadow RAM for addresses in the 20 KB video memory region. The Master RAM Board, made by Slogger, offered similar functionality for the Electron.
In systems based on the BBC Model B+, like the Acorn Cambridge Workstation, the screen memory can reside in either conventional RAM or shadow RAM. A programmable array logic chip controls access to memory and exposes the screen memory to the CPU by redirecting memory accesses to the appropriate memory locations. When shadow mode is enabled, the PAL chip monitors the addresses of instructions fetched by the CPU, and where such instructions have been fetched from a range of memory from to or from to, they are considered to be part of the VDU drivers that may access the screen memory.
Consequently, all memory accesses performed by instructions fetched from these VDU driver regions that then access memory in the range to are considered to be accessing screen memory, and the PAL chip asserts a signal to select the "shadow" 20 KB memory bank for such instructions so that they may read from or write to the screen. All other RAM accesses while in shadow mode are directed towards a contiguous region of RAM from to, if exposed) that does not host the screen memory. Meanwhile, in non-shadow or "normal" mode, this same contiguous region does host the screen memory, as is the convention in the traditional BBC Micro architecture, and the shadow memory is not accessible.

Extra RAM

The Model B+ provides 32 KB of additional RAM, with 20 KB used to shadow the screen memory. The remaining 12 KB can be made available in the memory region associated with sideways RAM, but the operating system does not recognise applications installed in this memory precisely as it would for conventional sideways RAM. This "private RAM" can be controlled independently, and since part of it coincides with the regions associated with VDU drivers, it provides a "killer feature" for games or other applications wishing to write to the screen memory directly in shadow mode, utilising their own fast routines instead of the more general, but slower, operating system routines.
Subsequent expansions for the BBC Model B also augmented the shadow RAM with additional RAM that could be used for other purposes. For instance, the Aries-B32 product permitted shadow/sideways RAM combinations of 20 KB/12 KB and 16 KB/16 KB, or the use of the 32 KB RAM as two sideways RAM banks.
The Slogger Master RAM Board offered a 32 K RAM solution for the Acorn Electron alongside a "turbo mode" enhancement. The additional RAM provided in this solution was exposed as a print buffer by Slogger's replacement operating system ROM, but exposed this RAM at the base of the memory map, thus supporting the turbo functionality – independent, accelerated memory access within that lower region – within shadow mode. Indeed, all of the RAM provided by the Master RAM Board was "fast RAM", accessed by the CPU at 2 MHz.

BBC Master Implementation

Unlike the expansion boards for earlier systems, the BBC Master implementation of shadow RAM permits the selection of either shadow memory or main memory for use as screen memory, this being done via the Access Control Register. By switching between main and shadow memory on alternate frames, double-buffered video could be used. Acorn provided a demonstration program in BASIC showing scrolling cloud animation with and without double buffering. The video game Firetrack would also use double buffering if shadow RAM was present.
On the BBC Master, shadow RAM is activated by setting the most significant bit of the memory mode number. For example, to use mode 1 with shadow RAM enabled, mode 129 is selected.
Another significant difference between the Master implementation of shadow RAM and previous implementations also offering 32 KB of shadow RAM is the allocation of the extra 12 KB beyond the 20 KB shadowing the screen memory. Instead of this memory occupying a single region from to in sideways RAM space, as it does with the Aries-B32 product and the BBC Model B+, it instead occupies two regions in the Master as "private RAM": a 4 KB region from to holding function key definitions, workspace for the operating system, and character and font definitions; an 8 KB region from to holding paged ROM and operating system workspace. Thus, the Master was able to support character set redefinition and to allocate memory to filing systems without the amount of available user RAM being reduced.

Patent Dispute

A dispute arose between the designers of the Aries-B20 shadow RAM board and two other companies offering similar products, Raven Micro Products and Watford Electronics, over the alleged infringement of patent GB2137382A describing techniques employed in the design of the Aries-B20 board. The products involved were the Raven Micro Products and Watford Electronics. Ultimately, in 1986, Watford Electronics acquired Aries Computers in a "five figure deal" including the patents involved, with Watford subsequently selling Aries' products alongside the company's own.