Skip to content
David Banks edited this page Jun 26, 2023 · 49 revisions

Contents

This page has been updated to reflect the Beta 8 release, which is available here:

https://github.com/hoglet67/BeebFpga/releases/latest

The Beta 8 release adds the following major feature:

  • External Pi Tube Coprocessor support using the PiTubeDirect Pi Firmware

The Beta 8 release adds the following minor features:

  • VideoNuLA now implements attribute mode 3 (Thomson)
  • T65 6502 Core updated to the version from AtomBusMon
  • Synchronize HDMI audio enable signal (prevents rare HDMI black screen crash)

Important: Changes for Beta 4 and later

Important: The Beta 4 and later releases require version v1.29e or above of TBBLUE.FW (“the next firmware”) and version 3.01.08 or above of TBBLUE.TBU ("the next core").

Earlier releases can be found here:

Overview

The BeebFpga project now includes two cores for the Spectrum Next:

  • a BBC Micro (Model B) core, using the cycle accurate T65 6502 implementation
  • a BBC Master core, using Alan Daly's 65C02 implementation

These cores include a common set of features:

  • High quality VGA output @ 50Hz
  • High quality HDMI output @ 50Hz
  • High quality DVI output @ 50Hz
  • Original sRGB SCART output @ 50Hz
  • Membrane Keyboard support
  • Dual Joystick support
  • Mouse support
  • Beeb SID support
  • Music 5000 support
  • Internal 4MHz 65C02 Co Processor (for Tube Elite!)
  • External PiTubeDirect Co Processor, see Co Processor Support below
  • VideoNuLA (an extended colour palette, and additional screen modes)
  • MMFS SD Card File System
  • Integrated ICE 6502/65C02 debugger (uses the Joystick 2 connector as a 115,200 baud serial port)

Known Issues

  • The HDMI audio quality is quite poor. This is because the 125KHz Beeb Audio is being resampled to 48KHz without any interpolation/decimation. This may be addressed in a future release.

  • The Spec Next keyboard mapping is not ideal for many BBC games. This may be improved in a future release.

Installation

The latest version of the Spectrum Next BeebFpga cores can be found here: https://github.com/hoglet67/BeebFpga/releases/latest

There are two release bundles:

  • beeb_fpga_spec_next_YYYYMMDD_HHMM_MMFS.zip
  • beeb_fpga_spec_next_YYYYMMDD_HHMM_MMFS2.zip

These differ in the file system that is include: MMFS or MMFS2.

MMFS is a stable SD card file system that provides access to thousands of disk images within a single container file (aka a BEEB.MMB file).

MMFS2 is an alternative file system that is still in development that dispenses with the MMB container file, and allows individual .ssd and/or .dsd disk images to be directly used.

The rest of this wiki page assumes the use of MMFS.

The MMFS release bundle contains the following files:

./machines/bbcmaster/adfs.rom
./machines/bbcmaster/basic4.rom
./machines/bbcmaster/beeb.cfg
./machines/bbcmaster/blank.rom
./machines/bbcmaster/core.bit
./machines/bbcmaster/core.cfg
./machines/bbcmaster/dfs.rom
./machines/bbcmaster/edit.rom
./machines/bbcmaster/mammfs2.rom
./machines/bbcmaster/mos.rom
./machines/bbcmaster/owl.rom
./machines/bbcmaster/terminal.rom
./machines/bbcmaster/view.rom
./machines/bbcmaster/viewsht.rom
./machines/bbcmodelb/basic2.rom
./machines/bbcmodelb/beeb.cfg
./machines/bbcmodelb/blank.rom
./machines/bbcmodelb/core.bit
./machines/bbcmodelb/core.cfg
./machines/bbcmodelb/os12.rom
./machines/bbcmodelb/rammas6.rom
./machines/bbcmodelb/swmmfs2.rom

These should be copied onto your Spec Next SD Card, preserving the directory structure.

When you start the Spectrum Next, press "C" to launch the Extra Core Updater, and follow the on-screen instructions. If you have installed the files correctly, you should find "Acorn BBC Master" and "Acorn Model B" cores are now available. Follow the on-screen instructions to program these into FLASH. You may use any slot.

ROMs

The BBC Micro (Model B) core preloads the following ROMs:

  • OS 1.20 (OS ROM)
  • Basic 2 (ROM 15)
  • RAM Master (ROM 14; a Sideways ROM manager utility)
  • MMFS (ROM 8; a SD Card File System)

The BBC Master core preloads the following ROMs:

  • MOS 3.20 (OS ROM)
  • Terminal (ROM 15)
  • View (ROM 14)
  • ADFS (ROM 13)
  • Basic 4 (ROM 12)
  • Edit (ROM 11)
  • View Sheet (ROM 10)
  • DFS (ROM 9)
  • Owl Logo (ROM 8)
  • MMFS (ROM 3; a SD Card File System)

The ROMs are preloaded by the Spec Next Multi-Core loader. Control is then passed to the Beeb core, which validates each of the ROMs by doing a CRC check, before starting the core. This only takes a few seconds, and is useful because of ROM corruption issues (that are hopefully now resolved).

MMFS SD Card File System

MMFS is a modern SD Card File System, widely used in the Acorn community, and is included as standard in the Beeb FPGA Cores. MMFS uses a FAT16/32 formatted SD Card containing a single file called BEEB.MMB. This file is normally ~100MB, and is a concatenation of 511 raw 200KB 80-track disc images.

There are two limitations with MMFS's use of the SD Card:

  • BEEB.MMB must be one of the first 16 files in the root directory
  • BEEB.MMB must be contiguous (i.e. it cannot be fragmented)

For these reasons, it's one option is to use a seperate SD card for MMFS, and hot swap the card once over once the Beeb core has booted. (Ctrl-BREAK must then be pressed).

However, it is possible to build a SD card that contains both MMFS's BEEB.MMB file, and the Spec Next distribution, by following these steps:

  • start with freshly formatted SD Card (FAT16 or FAT32)
  • copy the BEEB.MMB file to the SD Card
  • copy the Spec Next distribution files to the SD Card
  • copy the BeebFpga additional core files to the SD Card

Here is a link to a standard BEEB.MMB file: https://github.com/hoglet67/BeebFpga/releases/download/specnext_beta1/BEEB.MMB.zip

It contains the following

  • Disk 0: Stairway to Hell Archive MENU
  • Disk 1: Beeb FPGA Support Disk
  • Disk 2: MMFS 1.44 ROM images
  • Disk 3: Klaus Dormann 6502 Test Suite
  • Disk 4: Bruce Clark BCD Test Suite
  • Disks 20-252: Stairway to Hell Archive Disks
  • Disk 299: 6502 Co Processor Life
  • Disks 301-315: Beeb SID Demos
  • Disk 320: Music 5000 System Disk
  • Disks 323-352: Music 5000 Compilation Disks
  • Disk 360: Bad Apple
  • Disk 370: Video NulA System Disk
  • Disk 371-377: Video NulA Demo Disks (gallery, games, etc)
  • Disk 400-437: Retro Software Games

See the examples section below for some things to actually try out!

The complete MMFS Command Reference can be found here: https://github.com/hoglet67/MMFS/wiki/Command-Reference

Basic Operation

As there are several user configurable options (especially for the video output format), a set of ten virtual config keys has been added. These are referred to as Config-0 through to Config-9.

On the Membrane keyboard, the yellow NMI button in conjunction with a number key (0-9) selects a particular config key. For example, Config-1 is bound to Yellow NMI + 1.

On the PS/2 keyboard, Ctrl-Alt with a function key (F1..F10) selects a particular config key. For example, Config-1 is bound to Ctrl-Alt-F1. As there is no F0, Config-0 is bound to Ctrl-Alt-F10.

These configuration options are not persistent. So each time the core is re-loaded, they will be set from the beeb.cfg. See Core Configuration for what can be configured in each core.

Video Output Mode:

The video output mode can be selected with:

  • Config-1 - Video mode 1: RGB SCART with Composite Sync (15.625KHz)
  • Config-2 - Video mode 2: HDMI/VGA, using the RGBtoVGA scan doubler for Modes 0-6 and native VGA output for Mode 7 (default)
  • Config-3 - Video mode 3: HDMI/VGA, using the Mist scan doubler for all screen modes
  • Config-4 - Video mode 4: HDMI/VGA, using the Mist scan doubler for Modes 0-6, and native VGA output for Mode 7

The RGB SCART mode is identical to an original BBC Micro. It requires a VGA to SCART cable, and a television with an RGB capable SCART input. This mode will result in a blank screen on most VGA monitors.

The HDMI/VGA modes are all 50Hz, so your TV/Monitor must support 50Hz for this to work.

(For VGA I personally use a HP LP2065 monitor, which is excellent. Depending on the monitor, you may need to play around with the monitor's CLOCK and PHASE settings to get a good looking image.)

The recommended mode, especially for HDMI, is video mode 2. This uses 720x576p HDTV timings, with a 27MHz pixel clock. Scanline doubling and scanline retiming is used to adapt the Beeb's video timings to 27MHz.

Video Modes 3 and 4 use different pixel clocks (24MHz/32MHz), which may give a better image on some VGA monitors.

Additional HDMI options:

In addition to the main video mode, certain aspects of the HDMI stream can be adjusted:

  • Config-5 - HDMI audio/metadata on/off (default is on, off may be better for a DVI monitor)
  • Config-6 - HDMI aspect: auto (default)
  • Config-7 - HDMI aspect: 4:3
  • Config-8 - HDMI aspect: 16:9

Whilst older DVI-1 monitors are electrically compatible with HDMI, the presence of HDMI audio and metadata can prevent the video signal from being accepted. Config-5 turns off HDMI all audio and metadata, improving compatibility.

The signaled aspect ratio can also be adjusted by the user. The default behaviour (Config-6) is to select a 4:3 aspect ratio in Mode 0-6 and a 16:9 aspect ratio on Mode 7. This is done to avoid Mode 7 looking overly narrow, as it's only 480 pixels wide, compared to 640 in Mode 0-6.

Alternatively, you can select Config-7 for a fixed 4:3 aspect ratio, and Config-8 for a 16:9 aspect ratio.

It's important to note that changing the aspect ratio doesn't actually change the video content of the image in any way. It's just signalling to the TV how the source wants the "program" to be displayed. Most TVs allow the "program" aspect ratio to be overridden (i.e. ignored), so do check that the Aspect Ratio on TV is also set to "auto" or "original".

Miscellaneous options:

There are two further configuration options:

  • Config-9 - On the Model B this cycles between the available Co Processor Modes: Off, Internal, External if available. The default is off. A Control-BREAK is needed after changing this setting.

  • Config-0 - Debug on/off. The default is off. This setting enabled the ICE-6502/65C02 debugger; see ICE Debugger for more details. In addition, this setting adds a 1-pixel wide green border to the image, so you can determine whether the TV is overscanning or not. Many TVs (especially LG) will overscan 576p video.

Green Button

The green button on the Spec Next is no longer used.

Red Button

A short press on the Red (Reset) button will perform a power-up reset on the Beeb Core. This should recover from any possible program crash.

A long (1s) press on the Red (Reset) button will reconfigure the system back to the Spec Next core. This saves having to power cycle.

(This feature is not currently available on the PS/2 keyboard)

Membrane Keyboard Mapping

Mapping the 58-key Spectrum Next keyboard to 74-key BBC Micro keyboard was somewhat of a challenge.

The mapping is as follows:

Spec Next Key Beeb Key
BREAK BREAK
EDIT ESCAPE
TRUE VIDEO TAB
INV VIDEO COPY
CAPS LOCK CAPS LOCK
GRAPH CTRL
CAPS SHIFT SHIFT
EXTEND See below
SYMBOL SHIFT See below
DELETE DELETE
ENTER RETURN
Up/Down/Left/Right Up/Down/Left/Right
A-Z A-Z
0-9 0-9
; ; and +
" : and *
, , and <
. . and >

This misses out the following Beeb keys:

  • @
  • ‐ and =
  • ^ and ~
  • / and |
  • [ and {
  • ] and }
  • _ and £
  • / and ?

To access these, it's necessary to use the Spec Next SYMBOL SHIFT as a modifier, which operates exactly as it does in the Spec Next core. For example, SYMBOL SHIFT + L should give you =. i.e. just look for the key cap with the symbol character you need.

The EXTEND key is also used as a modifier to access the 10 red BBC function keys. For example, F1 is Extend + 1.

Finally, on the Membrane keyboard, the yellow NMI button in conjunction with a number key (0-9) selects a particular config key. For example, Config-1 is bound to Yellow NMI + 1.

See Basic Operation for a description of the config keys.

PS/2 Keyboard Mapping

The PS/2 Keyboard mapping is the same as other Beeb Fpga implementations, and attempts to map keys by physical position.

For example, the Beeb ; key is next to L, and the Beeb : key is just to the right of that, just like they are on a real Beeb keyboard.

This can be confusing at first, but it gives a better experience when playing games (most of the time!)

On the PS/2 keyboard, Ctrl-Alt with a function key (F1..F10) selects a particular config key. For example, Config-1 is bound to Ctrl-Alt-F1. As there is no F0, Config-0 is bound to Ctrl-Alt-F10.

See Basic Operation for a description of the config keys.

Other notable Beeb keys are:

PS/2 Key Beeb Key
F12 BREAK
Esc ESCAPE
End COPY
Backspace DELETE

Core Configuration

This Beeb cores are integrated with the standard Spec Next configuration files, which are used to determine the default video mode and keyboard type.

In addition, there is now a Beeb-specific configuration file (beeb.cfg) in each of the "bbcmaster" and "bbcmodelb" core directories.

General settings

These apply to both the BBC Master and BBC Micro (Model B) cores:

; =====================================
; General settings
; =====================================

; video
;     0 = RGB SCART
;     1 = HDMI/VGA (best)
;     2 = HDMI/VGA
;     3 = HDMI/VGA
;
; default is from from config.ini

; video = 1

; HDMI Audio
;     0=off
;     1=on
;
; default is from from config.ini

; hdmi_audio = 1

; HDMI Aspect Ratio
;     0=auto
;     1=4:3
;     2=16:9

hdmi_aspect = 0

; ICE Debugger (via UART on Joystick2)
;     0=off
;     1=on

debug = 0

; PS/2 Mode
;    0=keyboard
;    1=mouse
;
; default is from from config.ini

; ps2_mode = 0

; Show BeebFPGA Splash Screen
;     0=off
;    >0=on (value = duration in 100ms units)

splash = 14 ; hex!

; Whether to check the ROM crcs
;     0=no
;     1=yes
;

romcheck = 1

BBC Master settings

; =====================================
; BBC Master specific settings
; =====================================

; CMOS RAM Settings
; See http://beebwiki.mdfs.net/CMOS_configuration_RAM_allocation

cmos05 = C3 ; Default Filing System / Language
cmos06 = FF ; ROM frugal bits (*INSERT/*UNPLUG)
cmos07 = FF ; ROM frugal bits (*INSERT/*UNPLUG)
cmos08 = 00 ; Edit startup settings
cmos09 = 00 ; reserved for telecommunications applications
cmos0A = F7 ; VDU mode and *TV settings
cmos0B = 63 ; ADFS startup options, keyboard settings, floppy params
cmos0C = 20 ; Keyboard auto-repeat delay
cmos0D = 08 ; Keyboard auto-repeat rate
cmos0E = 0A ; Printer ignore character
cmos0F = 2C ; Default printer type, serial baud rate, ignore status and TUBE select
cmos10 = 84 ; Default serial data format, auto boot option, int/ext TUBE, bell amplitude

; ROM CRCs, for checking during boot

crc00 = 0000
crc01 = 0000
crc02 = 0000
crc03 = dd56
crc04 = 9402
crc06 = 0000
crc07 = 0000
crc08 = 81db
crc09 = c433
crc0A = e7c4
crc0B = b5b6
crc0C = 61d7
crc0D = b733
crc0E = 7621
crc0F = 64af

BBC Micro (Model B) settings

; =====================================
; BBC Model B specific settings
; =====================================

; Co Processor selection
;     0=disabled
;     1=internal
;     2=external

copro = 0

; Keyboard DIP settings
; See p246 of Advanced User Guide

keydip = 00

; ROM CRCs, for checking during boot

crc00 = 0000
crc01 = 0000
crc02 = 0000
crc03 = 0000
crc04 = 5cbf
crc06 = 0000
crc07 = 0000
crc08 = b4ab
crc09 = 0000
crc0A = 0000
crc0B = 0000
crc0C = 0000
crc0D = 0000
crc0E = 36b8
crc0F = 4274

Co Processor Support

BeebFPGA provides:

  • an internal 4MHz 65C02 Co Processor (for Tube Elite!)
  • an external PiTubeDirect Co Processor (using the Raspberry Pi Accelerator)

The Internal Co Processor is always available, as it's included in the FPGA itself.

The External Co Processor requires a Pi Accelerator to be present, and this needs to be running the PiTubeDirect firmware. Specifically, the hognose-fixes release of PiTubeDirect must be used. This release should be unzipped onto a blank FAT32 formatted SD card.

PiTubeDirect also provides a second display, using the mini-HDMI port on the Raspberry Pi.

Co Processor selection on the Master Core

On the Master core the Co Processor is selected using the build-in *CONFIGURE command:

To enable Co Processor support:

*CONFIGURE TUBE

To disable Co Processor support:

*CONFIGURE NOTUBE

To give the internal Co Processor priority use:

*CONFIGURE INTUBE

To give the external Co Processor priority use:

*CONFIGURE EXTUBE

After changing these settings, Ctrl-BREAK must be used.

The *STATUS command will display the current configuration.

The defaults are:

*CONFIGURE NOTUBE
*CONFIGURE EXTUBE

These defaults can by modified by editing the Master core beeb.cfg file and changing the cmos0f/cmos10 settings:

; cmos0f bit 0 is 0:NOTUBE 1:TUBE

; Default to *CONFIGURE NOTUBE
cmos0F = 2C
; Default to *CONFIGURE TUBE
cmos0F = 2D

; cmos10 bit 2 is 0:INTUBE 1:EXTUBE

; Default to *CONFIGURE INTUBE
cmos10 = 80
; Default to *CONFIGURE EXTUBE
cmos10 = 84

Co Processor Configuration on the Model B Core

On the Model B there is no build in command for Co Processor selection. Instead, the Config-9 button can be used to cycle between the available options:

  • Off
  • Internal
  • External (if available)

The default is Off.

This default can by modified by editing the Model B core beeb.cfg file and changing the copro setting:

; Co Processor selection
;     0=disabled
;     1=internal
;     2=external
copro = 0

External Co Processor detection

When the FPGA core boots, it passively detects the presence of the external Co Processor by looking for a specific value (0x55) on the data bus between the FPGA and the Pi. The PiTubeDirect firmware outputs this value when not selected using weak pullups. Only if this value is detected is the external Co Processor bus interface enabled. This prevents the possiblity of bus conflicts between FPGA and the Pi if other firmware (such as the NextPi firmware) is installed.

The BeebFPGA boot screen will indicate whether the external Co Processor has been detected, for example:

  • External PiTube detected (0x55)
  • External PiTube not detected (0xXX)

Important: You must be running the hognose-fixes release of PiTubeDirect for this detection to work.

External Co Processor usage

The PiTubeDirect firmware implements many different BBC Micro Co Processors.

It will default to Co Pro number 24, which is a very fast 65C02 that uses "JIT" technology to run at an equivalent speed of about 500MHz.

To select another Co Processor use:

*FX 151,230,n

then press Ctrl-BREAK.

The following values of n are supported:

 n   Processor
 0   65C02 (fast)
 1   65C02 (3MHz, for games compatbility)
 2   65C102 (fast)
 3   65C102 (4MHz, for games compatbility)
 4   Z80 (1.21)
 5   Z80 (2.00)
 6   Z80 (2.2c)
 7   Z80 (2.30)
 8   80286
 9   MC6809
11   PDP-11
12   ARM2
13   32016
14   Disable
15   ARM Native
16   LIB65C02 64K
17   LIB65C02 256K Turbo
18   65C816 (Dossy)
19   65C816 (ReCo)
20   OPC5LS
21   OPC6
22   OPC7
24 * 65C02 (JIT)
28   Ferranti F100-L

External Co Processor Test Programs

The External 65C02 Co Processor(s) include some built-in test programs that are copied into memory when the Co Processor is first selected.

  1. SPHERE Test

This is a simple graphical test.

OLD
LIST
RUN

LIST will show the PiTubeDirect firmware version.

  1. TRIANGLE Test

This is another simple graphical test.

PAGE=&C00
OLD
RUN
  1. CLOCKSP

This is a standard BBC benchmark.

PAGE=&1000
OLD
RUN
  1. Co Proessor List

This will list the available Co Processors.

CALL &2000
  1. 6502 DORMANN Tests

This is a 6502 test suite written by Klaus Dormann.

CALL&3400
  1. 65C02 DORMANN Tests

This is a 65C02 test suite written by Klaus Dormann.

CALL&C000

Using the PI HDMI Port as a second display

PiTubeDirect also includes a VDU driver allowing HDMI output from the Pi with many screen modes. See Pi-VDU-Driver and Pi-VDU-Fonts for more details.

To enable this, edit the cmdline.txt file on the Pi SD Card and set vdu=1

ICE Debugger

The BBC Cores now include a powerful ICE ("In-Circuit-Emulator) debugger, to allow machine code programs running on the core to be debugger.

The debugger uses joystick port 2 as a 115,200 baud serial port.

The following connections are used:

  • Pin 7 - Serial Out from ICE Debugger
  • Pin 8 - GND
  • Pin 9 - Serial In to ICE Debugger

You must use a 3.3V levels Serial Cable, such as one designed to work with a Raspberry Pi.

The only software required is a basic terminal emulator on a PC/Laptop.

To enable the debugger, edit beeb.cfg and set debug=1, then restart the core.

In the terminal emulator, when the core boots you should see a banner like:

ICE-65C02 In-Circuit Emulator version 0.981
Compiled at 16:19:10 on Dec 15 2019
8 watches/breakpoints implemented
Tracing every 1 instructions while single stepping
CPU free running...

Hitting return in the terminal emulator should get you a command prompt:

>>

You can then type help:

>> help

Further documention can be found here: https://github.com/hoglet67/AtomBusMon/wiki

In particular, there is a command reference here: https://github.com/hoglet67/AtomBusMon/wiki/User-Manual---Command-Reference

Examples

These instructions all assume the Master version of the Core is loaded, and the membrane keyboard is being used.

Planetoids

  • Shift-BREAK to boot STH Menu
  • 43
  • E
  • Enter

Rocket Raid

  • Shift-BREAK to boot STH Menu
  • 47
  • T
  • Enter

Pheonix (by Tricky)

  • *DBOOT 436

Tube Elite

  • Enable the Co Processor by pressing Config-9 (Yellow + 9)
  • Control Break (Control = GRAPH key)
  • *DIN 45
  • *TUBEELT
  • Press Space
  • Press F0 (Extend-0) to launch

The flight controls are documented here: http://www.elitehomepage.org/playguide.htm#A14

And here's a scan of the original "Space Trader's Flight Training Manual": https://openretro.org/file/37a540d376344ac9add72431ecf70ab46dfb7fe4

The Spec Next keyboard layout is not ideal for this!

Music 5000

  • *DBOOT 320
  • *DBOOT 320
  • Use Up/Down/Enter to select "Load program"
  • enter filename: ppach
  • Enter to "Run program"

Other music files on this disc are:

  • concert
  • pavane
  • ppach
  • jukebox

After pressing Escape, F0 (Extend-0) will return to the menu.

Beeb SID

  • *UNPLUG 9
  • Control BREAK
  • *DBOOT 305 ( or any disk from 301 to 315)

VideoNuLA Gallery 1/2

  • *UNPLUG 9
  • Control BREAK
  • *DBOOT 371 or *DBOOT 372