Home

Awesome

B-Em

Introduction

B-em is an emulator for various models of BBC Microcomputer as made by Acorn Computers in the 1980s along with a selection of 2nd processors. It is supported for Win32 and Linux/UNIX but may also work on other systems supported by the Allegro library.

B-em is licensed under the GPL, see COPYING for more details.

DEVELOPMENT

Development is active! If you want to know how to work with us, then please make sure you have a look at the SUBMITTING_PATCHES.md file

TODO File

A TODO.md file exists, with ideas for future functionality for future versions of B-em.

Contact

B-em is maintained by a group of volunteers -- please enquire over on the stardot forums for more details.

Compiling

Linux

You will need the following libraries:

Linux distros which include Allegro 5.2 at the time of writing include:

Allegro 5.2 packages for Ubuntu 16.04 LTS can be had from Launchpad

Released version

Open a terminal window, navigate to the B-em directory then enter:

./configure && make

From Git Sources

./autogen.sh && ./configure && make

Notes

Windows

You will need version 5.2.2.0 of Allegro from:

https://github.com/liballeg/allegro5/releases/tag/5.2.2.0

Later versions have a bug which prevents the ticks in the menus from working correctly. There is a choice of compilers but these instructions only cover MingW and assume you have this correctly installed.

Unpack/clone B-Em into a folder and unpack the Allegro5 into a parallel folder, i.e. so the allegro folder and the b-em folder have the same parent and then from within the b-em folder run makebem.bat

Notes

Features

New Features

New With V2.2

New Since Version 2.2

##Features

Bug Fixes

Default keyboard mapping

BBC keyPC key
BREAKf12
*:@'
+;:;
-=-_
^~+=
f0f0 (function keys are based on keycaps, not positioning)
3#3
6&6
7'7
8(8
9)9
00
Shift lock -ALT

The PC key Page Up acts as a speedup key and Page Down as pause.

GUI

The options are:

File

OptionMeaning
Hard resetresets the emulator, clearing all memory.
Load stateload a previously saved savestate.
Save statesave current emulation status.
Save Screenshotsave the current screen to a file
Exitexit to OS.

Edit

OptionMeaning
Paste via Keyboardsend the contents of the clipbaord as keystoked
Printer to Clipboardcapture printer output and copy to clipboard

Disc

OptionMeaning
Autoboot disc 0/2load a disc image into drives 0 and 2, and boot it.
Load disc 0/2load a disc image into drives 0 and 2.
Load disc 1/3load a disc image into drives 1 and 3.
Eject disc 0/2removes disc image from drives 0 and 2.
Eject disc 1/3removes disc image from drives 1 and 3.
New disc 0/2creates a new DFS/ADFS disc and loads it into drives 0 and 2.
New disc 1/3creates a new DFS/ADFS disc and loads it into drives 1 and 3.
Write protect disc 0/2toggles write protection on drives 0 and 2.
Write protect disc 1/3toggles write protection on drives 1 and 3.
Default write protectdetermines whether loaded discs are write protected by default
IDE Hard discEnables emulation of an IDE hard disc
SCSI Hard discEnables emulation of a SCSI hard disc
Enable VDFSEnable a subset of host OS files to be visible as an Acorn filing system
Choose VDFS RootChose the directory on the host that is visible via VDFS

Tape

OptionMeaning
Load tapeload a tape image.
Eject taperemoves a tape image.
Rewind taperewind the emulated tape.
Show tape catalogueshows the catalogue of the current tape image.
Tape speedselect between normal and fast tape speed.

ROMS

This menu shows the contents of the Sideways ROM/RAM banks and enables these to be loaded with a different ROM, enabled as RAM or cleared.

Model

This lists the models in alphabetical order and enabled the model being emulated to be changed. Be aware this causes a reset.

Tube

This lists the available second processors and enabled one to be chosen. The choice in this menu is overridden if the model picked in the model menu is always supplied with a 2nd processor, for example the Master 512. For models like this the bundled 2nd processor is always used.

Settings

Video

Display Type

OptionMeaning
Line Doublingstretch the BBC screen by doubling every line.
Scanlinesstretch the BBC screen by blanking every other line
Interlacedemulate an interlaced display (useful for a handful of demos). Allows high resolution mode 7.
PALuse PAL filter!
PAL interlaceduse PAL filter, with interlacing. Slow! Allows high resolution mode 7.

Borders

OptionMeaning
NoneRemove all the black space around the image area.
Mediumborders intended to be attractive rather than accurate
FullThe full borders as seen on an old TV
OptionMeaning
Fullscreenenters fullscreen mode. Use ALT-ENTER to return to windowed mode.

Sound

OptionMeaning
Internal sound chipenable output of the normal BBC sound chip.
BeebSIDenable output of the SID emulation.
Music 5000enable output from an emulated Music 5000 synth
Printer Port DACenable output of 8-bit DAC connected to the printer port.
Disc drive noiseenable output of the disc drive sounds.
Tape noiseenable output of the cassette emulation.
Internal sound filterenable bandpass filtering of sound. Reproduces the poor quality of the internal speaker.
Internal waveformchoose between several waveforms for the normal BBC sound chip. Square wave is the original.

reSID configuration

OptionMeaning
Modelchoose between many different models of SID. Many tunes sound quite different depending on the model chosen.
Simple methodChoose between interpolation and resampling. Resampling is in theory higher quality, but I can't tell the difference.
Disc drive typechoose between sound from 5.25" drive or 3.5" drive.
Disc drive volumeset the relative volume of the disc drive noise.

Keyboard

OptionMeaning
Redefine keysredefine keyboard setup. Map CAPS/CTRL to A/S - remaps those 2 keys. Useful for games where CAPS/CTRL are left/right.

Mouse

OptionMeaning
AMX mouseenables AMX mouse emulation.

Speed

Choose an soeed relative to a real model of that type.

Debug

OptionMeaning
DebuggerEnters debugger for debugging the main 6502. Type '?' to get list of commands.
Debug TubeEnters debugger for debugging the current 2nd processor.
Breakbreak into debugger.

Command Line Options

b-em [discimage|tapeimage|snapshot] [-u name.uef] [-mx] [-tx] [-i] [-c] [-fx] [-spx]

discimage name.ssd/dsd/adf/adl/img etc. tapeimage name.uef/csw snapshote name.snp (previously saved snapshot) -u name.uef - load UEF image name.uef

-mx - model to emulate, where x is

0 - BBC A with OS 0.1
1 - BBC B with OS 0.1
2 - BBC A
3 - BBC B with 8271 FDC
4 - BBC B with 8271 FDC + loads of sideways RAM
5 - BBC B with 1770 FDC + loads of sideways RAM
6 - BBC B US with 8271 FDC
7 - BBC B German with 8271 FDC
8 - B+ 64K
9 - B+ 128K
10 - Master 128 w/ MOS 3.20
11 - Master 512
12 - Master Turbo
13 - Master Compact
14 - ARM Evaluation System
15 - Master 128 w/ MOS 3.50
16 - BBC B with no FDC + loads of sideways RAM
17 - BBC B w/Solidisk 1770 FDC
18 - BBC B w/Opus 1770 FDC
19 - BBC B w/Watford 1770 FDC
20 - BBC B w/65C02, Acorn 1770
21 - BBC B with 65C02, no FDC

-tx - enable tube, where x is:

0 - 6502 (internal)
1 - ARM (Master only)
2 - Z80
3 - 80186 (Master only)
4 - 65816 (if ROMs available)
5 - 32016
6 - 6502 (external)

-i - enable interlace mode (only useful on a couple of demos)

-c - enables scanlines

-fx - set frameskip to x (1-9, 1=no skip)

-fasttape - speeds up tape access

-spx - emulation speed where x is 0 to 9 (default = 4)

IDE Hard Discs

To initialise a hard disc, use the included HDINIT program. Press 'I' to investigate the drive - this will set up the default parameters for a 50 mb drive. If you want a different size press 'Z' and enter the desired size - it does not matter that this does not match the size given in the emulated hardware.

Then press 'F' to format, and follow the prompts.

Master 512

Master 512 includes mouse emulation. This is used by trapping the mouse in the emulator window - click in the window to capture it, and press CTRL + END to release.

All disc images used by the Master 512 should have the .img extension - the type is determined by size. Both 640k and 800k discs are supported, as well as DOS standard 360k and 720k.

You can use the IDE hard disc emulation with this, run HDISK.CMD in DOS-Plus, then HDINSTAL.BAT. Go make a cup of tea while doing this, it takes forever! HDISK.CMD will create a file 'DRIVE_C' in ADFS so you will need to format the hard disc using ADFS first.

65816 coprocessor

The ROMs for this coprocessor are not included with the emulator. You will need to acquire the file ReCo6502ROM_816 and place it in roms\tube.

The 65816 runs at 16mhz, regardless of what the firmware is set to.

Hardware emulated

ProcessorMeaning
The 6502 processorAll instructions should be emulated. Attempts to be cycle perfect. 65C02 is emulated for Master 128 mode.
The 65C12 tubeAs a parasite processor.
The 65816 tubeAs a parasite processor. Emulator from Snem.
The Z80 tubeAs a parasite processor. Probably a few bugs. Emulator from ZX82.
The ARM processorAs a parasite processor for Master 128 only. Emulator from Arculator.
The 80186 tubeAs a parasite processor for Master 512 only. Emulator from PCem.
The 6845 CRTCCycle-exact emulation. Runs everything I've tried, with all effects working.
The Video ULACycle-exact emulation, though I think palette changes are a cycle off? Might be a delay in the real chip.
The System VIAKeyboard and sound emulated. Also CMOS on Master-based models.
The User VIAEmulated.
8271 FDCDouble disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only access of protected FDI images.
1770 FDCDouble disc, double sided, 40/80 tracks, read/write. With authentic noise. Supports read-only access of protected FDI images.
IDE hard discEmulates 2 discs. Emulation from Arculator.
SCSI hard discEmulates 4 discs. Emulation from BeebEm.
SoundAll channels emulated, with sample support and some undocumented behaviour (Crazee Rider). With optional bandpass filter.
BeebSIDEmulated using resid-fp, so should be pretty accurate. Is only emulated when accessed, to reduce CPU load.
ADCReal joystick emulation, supporting both joysticks.
6850 ACIAEmulated for cassettes. Read only.
Serial ULAEmulated.
Music 5000Hybrid synth emulated. Emulation from Beech
Music 4000Hybrid music keyboard. Emulated via MIDI, Emulation original to B-Em
Music 2000Hybrid MIDI I/F. Connects to host MIDI, Emulation original to B-Em

Hardware NOT emulated

Thanks

Acorn for making the BBC in the first place:

David Allen,Bob Austin,Ram Banerjee,Paul Bond,Allen Boothroyd,Cambridge, Cleartone,John Coll,John Cox,Andy Cripps,Chris Curry,6502 designers, Jeremy Dion,Tim Dobson,Joe Dunn,Paul Farrell,Ferranti,Steve Furber,Jon Gibbons, Andrew Gordon,Lawrence Hardwick,Dylan Harris,Hermann Hauser,Hitachi, Andy Hopper,ICL,Martin Jackson,Brian Jones,Chris Jordan,David King, David Kitson,Paul Kriwaczek,Computer Laboratory,Peter Miller,Arthur Norman, Glyn Phillips,Mike Prees,John Radcliffe,Wilberforce Road,Peter Robinson, Richard Russell,Kim Spence-Jones,Graham Tebby,Jon Thackray,Chris Turner, Adrian Warner,Roger Wilson and Alan Wright for contributing to the development of the BBC Computer (among others too numerous to mention)