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 ({{mono|0x0000}} to {{mono|0x7FFF}}), 16 KB sideways "paged" address space ({{mono|0x8000}} to {{mono|0xBFFF}}) and 16 KB operating system space ({{mono|0xC000}} to {{mono|0xFFFF}}). Video or screen memory is typically allocated from {{mono|0x7FFF}} downwards as necessary, occupying as little as 1 KB for Teletext mode 7 (and thus the region from {{mono|0x7C00}} to {{mono|0x7FFF}}), or as much as 20 KB for modes 0-2 (and thus the region from {{mono|0x3000}} to {{mono|0x7FFF}}). 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, the amount of shadow RAM provided is typically 20 KB.

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,{{ cite news | url=https://archive.org/details/AcornUser018-Jan84/page/n11/mode/1up | title=52k BBC micro | work=Acorn User | date=January 1984 | accessdate=10 October 2020 | pages=10 }} 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.{{cite news | url=https://archive.org/details/AcornUser021-Apr84/page/n163/mode/1up | title=A 20K RAM boost for the 'B' with a unique paging system | work=Acorn User | date=April 1984 | accessdate=29 August 2020 | pages=162 }}

In systems based on the BBC Model B+, like the Acorn Cambridge Workstation, a programmable array logic (PAL) 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 {{mono|0xA000}} to {{mono|0xAFFF}} or from {{mono|0xC000}} to {{mono|0xDFFF}}, 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 {{mono|0x3000}} to {{mono|0x7FFF}} 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 {{mono|0x0000}} to {{mono|0x7FFF}} (and potentially up to {{mono|0xAFFF}}, 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.{{ cite book | url=https://archive.org/details/manualzilla-id-6902081/page/76/mode/2up | title=ACW Service Manual | publisher=Acorn Computers Limited | last1=Watters | first1=C. | last2=Wilkins | first2=J. | issue=1 | date=7 January 1987 | access-date=23 March 2022 | pages=43–45, 76–77 }}

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.{{ cite book | url=http://www.microcomputer.org.uk/documents/manuals/BBC%20Master/Master_ref_1.pdf#page=229 | title=The BBC Microcomputer System Master Series Reference Manual Part 1 | publisher=Acorn Computers Limited | date=1986 | accessdate=30 August 2020 | pages=F.2–3 }} 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 (and also the BBC Model B+{{ cite news | url=https://archive.org/details/AcornUser035-Jun85/page/n8/mode/1up | work=Acorn User | title=BBC B+ revealed | date=June 1985 | accessdate=30 August 2020 | pages=7, 11 }}), 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 (128 combined with 1) 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 {{mono|0x8000}} to {{mono|0xAFFF}} 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 {{mono|0x8000}} to {{mono|0x8FFF}} holding function key definitions, workspace for the operating system, and character and font definitions; an 8 KB region from {{mono|0xC000}} to {{mono|0xDFFF}} holding paged (sideways) 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.{{ cite news | url=https://archive.org/details/AcornUser044-Mar86/page/n74/mode/1up | title=Master Work | work=Acorn User | date=March 1986 | accessdate=19 October 2020 | last1=Smith | first1=Bruce | pages=73–77 }}

Further Refinements

Subsequent products 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 16KB/16KB, or the use of the 32 KB RAM as two sideways RAM banks.{{cite book | url=http://chrisacorns.computinghistory.org.uk/docs/Aries/Aries_B32Manual.pdf | title=Aries-B32 32K RAM expansion for the BBC Microcomputer Model B | publisher=Aries Computers | accessdate=29 August 2020 | pages=6 }} The Slogger Master RAM Board offered a 32K RAM solution for the Acorn Electron alongside a "turbo mode" enhancement.{{ cite news | url=https://archive.org/details/AcornUser057-Apr87/page/n147/mode/2up | title=Slogging it out | author=Emblem, Bernard | work=Acorn User | date=April 1987 | accessdate=29 August 2020 | pages=146–147 }}

Patent Dispute

A dispute arose between the designers of the Aries-B20 shadow RAM board (Aries Computers Limited) 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.{{cite news | url=https://archive.org/details/AcornUser029-Dec84/page/n17/mode/1up | title=Patent clash over boards | work=Acorn User | date=December 1984 | accessdate=29 August 2020 | pages=16}} The products involved were the Raven Micro Products (Raven-20) and Watford Electronics (32K RAM Expansion Board). 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.{{cite news | url=https://archive.org/details/AcornUser048-Jul86/page/n10/mode/1up | title=Aries acquired | work=Acorn User | date=July 1986 | accessdate=3 September 2020 | pages=9}}

References