This article contains instructions on how to build the 65Host family of emulators for the RISC OS platform, including the previously unreleased 65Turbo emulator which is used to build the BBC MOS sources. Instructions are also included on how to use this emulator to build the BBC MOS.
This article builds version 1.20 of the BBC MOS, which was the final version shipped on the original BBC Micro.
This article builds version 1.00 of 65Host, which is between RISC OS 2's 0.97 and RISC OS 3's 1.20.
Source code to the following is included in the archives here:
These sources were originally built on machines that would have been running versions of Arthur or pre-production versions of RISC OS 2. But they can be built on more modern versions of RISC OS.
You will need:
Unzip and drop a copy of AASM into the Library
directory
in the root of the filesystem, this will add the assembler to the path.
Unzip the copy of the RO2 headers to the
root of the filesystem, in the directory Hdr
These files
can have their type set to Text
to read them, but it is not
required for building.
Unzip the 6502Goodies bundle to the
root of the filesystem in the directories BBCWini
and Emu6502
The sources as distributed are setup for builing on a specific machine, network and assembler inside of Acorn. The following changes allow us to build it locally.
Emu6502.NewEmulate.MakeHost
,
Emu6502.NewEmulate.MakeTube
and Emu6502.NewEmulate.MakeTurbo
to obey
Emu6502.NewEmulate
create empty directories
called Image
and rm
.Emu6502.HostEmuOS.os1_20
to Emu6502.NewEmulate.os1_20
Emu6502.TubeEmuOS.TubeOS
to Emu6502.NewEmulate.TubeOS
Emu6502.NewEmulate.Glue.Host
change the line net#arf:$.SSwales.OS120_e
to os1_20
Emu6502.NewEmulate.Glue.Tube
change the line net#arf:$.SSwales.TubeOS
to TubeOS
Emu6502.NewEmulate.Glue.Turbo
change the line net#arf:$.SSwales.TubeOS
to TubeOS
Emu6502.NewEmulate.EmuBody
Move line 302 that starts adcChannel
to outside the conditional compilation section, e.g to line 310Emu6502.NewEmulate.EmuTube
Modify line 26 change wheretoexecuteit
to whereToExecuteIt
, case sensitive.Emu6502.NewEmulate.EmuTube
Modify line 221 change wheretoexecuteit
to whereToExecuteIt
, case sensitive.Emu6502.NewEmulate.EmuTube
Modify line 222 change lastwheretoexecuteit
to lastWhereToExecuteIt
, case sensitive.Open a RISC OS task window
*dir Emu6502.NewEmulate *MakeHost *MakeTube *MakeTurbo
If everything built correctly you should have three modules in
Emu6502.NewEmulate.rm
called 65Host
, 65Tube
and 65Turbo
.
Double clicking these modules runs them and should look like this; NOTE 65Host does not have a working keyboard at this point, we will return to this later, nor can you quit it yet (ARFS below adds *quit), use alt-break to exit.
It may seem odd that to build the BBC OS the first thing was to compile up a set of 6502 emulators for another platform, but it does make sense. The OS was so large it could only be assembled on special, and mostly Acorn internal, second processors which was a 6502 with 256KB of RAM (rather than the 32KB of the standard 'B' or the 64KB of the regular 6502 second processor).
Referred to as the 'Turbo' second processor (unrelated to the BBC Master Turbo), finding a physical one would be very tricky. Luckily we built an emulator of one in the section above, 65turbo.
The source to the MOS here is written
in MASM format, and needs the TurMASM
assembler.
BBCWini.Library.TurMasm
to Emu6502.HostEmuOS.TurMasm
Emu6502.HostEmuOS
create the empty directory x
Emu6502.HostEmuOS.MOSHdr
change GBLL Tutu
to GBLL $Tutu
Emu6502.HostEmuOS.MakeMOS
change the line 74
to 76
Open a RISC OS task window
*rmload Emu6502.NewEmulate.rm.65Turbo *EmulateTurbo
We are now inside the 6502Turbo emulator but with access to the RISC OS filesystem.
*dir Emu6502.HostEmuOS
At this point we have a choice: build the original OS 1.20 ROM or build the slight variation for use with 65Host. These are build options in the source code. We shall build both.
*exec MakeMOS
This should generate the file MOS1_20
in the
Emu6502.HostEmuOS
directory. This is identical to the ROM
shipped on the BBC Model B.
*exec MakeHost
This should generate the file HostOS
in the
Emu6502.HostEmuOS
directory. This version cleverly uses
undefined 6502 instructions to talk the the host OS to allow the
keyboard messages to be passed.
MakeHost
; Emu6502.HostEmuOS.HostOS
to Emu6502.NewEmulate.HostOS
Emu6502.NewEmulate.Glue.Host
change the line os1_20
to HostOS
Open a RISC OS task window
*dir Emu6502.NewEmulate *MakeHost
This should generate an updated module 65Host
in Emu6502.NewEmulate.rm
ARFS is the filing system for !65Host that lets the user access the RISC OS filesystem as if it were a BBC filing system.
BBCWini.Library.TurMasm
to Emu6502.arfs.TurMasm
Emu6502.arfs
create the empty directory x
Open a RISC OS task window
*rmload Emu6502.NewEmulate.rm.65Turbo *EmulateTurbo *dir Emu6502.arfs *exec asmbbc
Note: During this building you will see many spurious characters output, the 'ofla' message if on RISC OS 3.7 for example, however the build does succeed.
This should generate the file arfs
in the Emu6502.arfs
directory.
To create a more 'finished' product version of 65Host we will roughly follow the instructions
of Emu6502.NewEmulate.!Release
to combine our built files with a copy of !65Host
off the Apps disc.
Emu6502.NewEmulate.rm.65Host
to !65Host.!RunImage
Emu6502.arfs.arfs
to !65Host.arfs
!65Host.arfs
to BBC ROM