Emulation by Gerald Fitton

Lust, thro’ some certain strainers well refin’d, Is gentle love, and charms all womankind: Envy, to which th’ ignoble mind’s a slave, Is emulation in the learn’d or brave: Nor virtue, male or female, can we name, But what will grow on pride, or grow on shame.

Alexander Pope (1688 - 1744) An Essay on Man: Epistle II (1733) Alexander Pope

Alexander Pope was an 18th-century English poet, best known for his satirical verse and for his translation of Homer. In his Essay on Man he suggests that, rather than feel envious of someone else’s superior abilities or their situation, we should regard them as an example to be emulated. Through emulation rather than envy there are times when the pupil overtakes their master to become better than the person whom, initially, they were seeking to emulate. Is this what has happened to RISC OS?

Building a

I am sure that, like me, many of you will have built a Windows Desktop computer from parts. I have a vague recollection of reading a series of articles in Archive describing how to do it. The components are: a tower, usually complete with power supply and control buttons; a motherboard usually complete with a CPU, heatsink, fan, ports for ethernet, mouse, keyboard and USB connections; 2 or 4 strips of RAM which are plugged into the motherboard; often, but not always, there is a separate graphics card and, less often these days, a separate sound card; the component list is completed with a DVD writer, one or more hard drives and, rarely these days, a floppy disc drive.

I have lost track of the number of Windows Desktop machines I have built from components but it must be about a dozen starting sometime around 1995. What happens in my case is that I build a new one, sometimes just for fun but more usually because I want to know how the latest ‘kit’ (hardware) works; my current machine then gets relegated to being my backup machine and my backup machine (sometimes in modified form) nearly always is given to one of my four grandchildren. Eventually, the grandchild’s machine become irreparable or too out of date for the purposes for which they want to use it; then I salvage useful parts such as the hard drive or DVD writer and use them as spare parts for friends and neighbours who either want to expand their machine (e.g. an extra hard drive) or need a ‘swop out’ to discover a faulty component.

In addition to my Windows Desktop machinery I have a genuine RiscPC which must be getting on for 20 years old but still working well. I think it was in 1996 that I upgraded it to a StrongArm machine. Since then I have replaced a few parts (e.g. hard drive) in order to keep it alive, but gradually, since about 2002, my use of this reliable piece of hardware has reduced until now it is more than a year since I switched it on! RISC OS Emulators

So what is it that have I used since 2002 to run my favourite pieces of RISC OS software such as PipeDream, Fireworkz, etc? Well, the answer to that question for the ‘noughties’ is that I installed a Red Squirrel Emulator on my Windows Desktop machinery.

Currently I have 3 different ‘in use’ RISC OS Emulators on my Windows 8 machine and, in my next few articles, I shall tell you something about each of them. The 3 StrongArm emulators which I have are Red Squirrel (installed 2002), RPCEmu and VirtualRPC-SA. The for all of them is RISC OS 4.02. Also I have a copy of VA5000.

Building a RISC OS Computer

Just as it is possible to build a hardware Desktop machine from component parts, so it is possible to built a RISC OS Emulator from its components parts. Building a RISC OS emulator is just as much fun as building a Windows desktop but it is considerably cheaper! At most it will cost you £5 to build a D-I-Y RISC OS 4.02 Emulator which runs on a Windows machine. The cost of a RISC OS 3.70 Emulator is zero!

Whilst there used to be a considerable financial advantage in building a Windows Desktop machine rather than buying a ready built one, today that is not true. Nowadays the principal advantage of building it yourself is that you know of what it consists so that, if something dies, then the chances are that you can repair it much more cost effectively than if you were to take it to a computer specialist to get it fixed. Furthermore, if you want to improve its performance then you can buy, for example, a higher specification graphics card and thus process your latest video much more quickly.

There are similar advantages to building a RISC OS Emulator yourself rather than buying a ready made one. For example, I keep more than one fully working copy of my emulators on my machine so that, if I do something stupid and break it then I can restore the broken emulator from my backup. Having built it I know which files to restore from the backup.

The three principal components of a RISC OS emulator are: the machine emulation, the operating system ROMs and what I shall call the Boot Resources. Of course, in addition to these three components you do need Application software such as !SparkPlug, !Paint, !Edit, !PipeDream, !, !Ovation Pro, etc. The set of operating system ROMs I have in all three of my working emulators is RISC OS 4.02 and my Boot Resources software is pretty much the same in all three. Only the hardware emulation is different.

Red Squirrel

This month I shall concentrate on Red Squirrel partly because that is the hardware emulator which I have used for the longest time and about which I know the most.

The software for the Red Squirrel hardware emulator was developed by Graeme Barnes as a machine emulator for many Arm based platforms including the ArmLinux, NetBSD, RiscIX, etc. It is the precursor of all the Virtual Acorn emulators from the Virtual A5000 (introduced in 2002 and discontinued in 2004), to the still supported VirtualRPC series. If you have a VirtualRPC and you want another emulator then, because of the similarity of the user interface between Red Squirrel and VirtualRPC, you may find that the Red Squirrel emulator will suit you best. Perhaps you have a second Windows machine on which you want to run RISC OS but you don’t think you can justify the cost of buying a second copy of VirtualRPC. In this case I suggest that building a Red Squirrel emulator is something that you might enjoy and from which you will ultimately benefit.

To my surprise I found that the Red Squirrel website still exists but in a form frozen on the 17th January 2004. You will find it at: http://www.redsquirrel.fsnet.co.uk/redsquirrel.html.

The reply to Question 23 of the Frequently Asked Questions (click on the calculator icon on the right hand side of the task bar of the Red Squirrel website) includes a promise by Graeme that, “Whatever happens there will always be a freeware version of Red Squirrel for personal use”.

The version which I run is the most recent version; it is Version 0.6, last updated on the 28th October 2002; Graeme has fulfilled his promise that it will always be available.

ROMs and Boot Resources

The ROM images and the Boot Resources can be found on the website which you’ll find at: http://www.4corn.co.uk. These are available free of charge.

Resources

On your Windows machine, somewhere within My Documents create a New Folder and call it ‘RedSquirrel’. Inside ‘RedSquirrel’ create a New Folder and call it ‘Resources’.

Go to the Red Squirrel website http://www.redsquirrel.fsnet.co.uk/redsquirrel.html and click on the ‘downloads’ icon. This ‘downloads’ icon is the floppy disc icon on the left hand side of the icon bar. Alternatively click on ‘downloads’ which you’ll find alongside the date 28/10/2002. You will be redirected to a page from which you can download version 0.6 (the last available free version) by clicking on the link ‘RedSquirrel0.6.zip’. Save this zip archive within your ‘Resources’ folder.

Go to: http://www.4corn.co.uk/cgi/download.php?sFName=/roms/riscos3_70.zip where you will find that you can download the set of 4 RISC OS 3.70 ROMs contained within a zip archive called ‘riscos3_70.zip’. Save this zip archive within ‘Resources’.

Finally, http://www.4corn.co.uk/_archive/acornftp/riscos/releases/UniBoot/uniboot.zip is where you will find the Boot Resources that you will need. Save the zip archive called ‘uniboot.zip’ in your ‘Resources’ folder.

Then, for reasons which will become clear later, rename this as ‘unibootR.zip’.

In case you are wondering, the ‘R’ stands for RISC OS; later I shall refer to a zip archive called ‘unibootW.zip’ in which the ‘W’ stands for Windows. I wish to distinguish between ‘unibootR.zip’ and ‘unibootW.zip’. Hardware Emulator

From within your RedSquirrel folder create another New Folder and call it ‘TestBuild-01’. This will contain your first attempt to build yourself a RISC OS 3.70 Emulator.

Stay in the Windows environment, unzip ‘RedSquirrel0.6.zip’ to reveal a sub folder called ‘RedSquirrel Release’. Open ‘RedSquirrel Release’ and save the contents within your ‘TestBuild-01’ folder. I say “Stay in the Windows environment” because you may already have a RISC OS emulator running and you may have made the mistake of unpacking ‘RedSquirrel0.6.zip’ from within RISC OS. For some, but not all zip archives, it is important that you extract the files from them in RISC OS and not Windows (and vice versa). As we shall see later, ‘unibootR.zip’ is such an environmentally sensitive archive.

I have to emphasise that Red Squirrel emulates only the StrongArm hardware. It does not include the RISC OS Operating System ROMs nor does it include what I am calling the Boot Resources.

When you download the hardware emulator and open the zip archive in Windows then you will see that it contains the files and folders shown in the screenshot below.

To turn this set of files into a working machine all that you need to do is to load a set of RISC OS 3.7 ROM images into the directory called RomSets and load what I am calling Boot Resources into the directory Hostfs. If you do this then, with not much more effort, you will find yourself with a working StrongArm machine running RISC OS 3.7!

Loading the ROMs

You can unzip ‘riscos3_70.zip’ within the Windows environment.

Open the folder called RomSets (within your ‘TestBuild-01’ folder) and you will find several sub folders in there. One of these is called Riscos370. Open it and copy the 4 ROMs (called ROM1, ROM2, ROM3 and ROM4) into this folder. Although it is not vital to do so in this case, somewhat pedantically I would prefer that you rename the ROMs (in Windows) by appending a ‘,ffd’ to each so that they become ‘ROM1,ffd’ etc. First Test

At this point you can carry out a test to see whether what you have done is correct and if what you have built is working. Of course the emulator won’t run completely because, at the moment, you have not loaded any Boot Resources.

Open the folder ‘Test-Build-01’ and double click on the ‘.exe’ file ‘RedSquirrel,exe’. The emulator will start up; it will display the screen shown below. Click on ‘Go for it’.

The ‘Select Model’ screen will be displayed. Select ‘RiscPC SA, RISC OS 3.7’. This is the model for which you have loaded the Operating System ROMs; there are no ROMs in the other models displayed here so it is not surprising that selecting one of them doesn’t work. Click on OK and the RISC OS Emulator tries to run but cannot find any Boot Resources. You will see a screen similar to the one shown below. From this screen you can see that you have configured 34MB of RAM, chosen the StrongArm processor and you do have a RISC OS filing system which is looking within HostFS for the missing Boot Resources.

Boot Resources

Within your ‘TestBuild-01’ folder there is a sub folder called ‘Hostfs’. Within ‘Hostfs’ there are several sub folders for different models. One of these folders is called Disk370. It is into this folder that you need to place the unzipped Boot Resources.

There is a problem which arises and it is that, if you unzip the version of Uniboot which you have renamed as ‘unibootR.zip’ from within a Windows environment, then it won’t work. I shall explain why later in this article and I’ll show you how to overcome this problem. However, for now, let’s take a short cut.

I have converted the ‘unibootR.zip’ archive into one suitable for unzipping from within Windows and called it ‘unibootW.zip’. You will find this Windows friendly version of Uniboot on the website. Download it and save it in your ‘Resources’ folder.

Unzip ‘unibootW.zip’ and, within it, you will see a folder called ‘!Boot’. Staying in the Windows environment, copy this version of !Boot into the Disk370 folder which is within Hostfs.

Second Test

You have created a simple RISC OS 3.70 Emulator; let’s see if it works.

Double click on ‘RedSquirrel.exe’ again, ‘Go for it’ and select the same SA model. This will load a fully working RISC OS 3.70 Emulator and you will see the screenshot on the left below. Click on the monitor icon at the bottom right and you will find that you have 256 Colours and the Resolution is 800x600 pixels. The screenshot on the right shows what you will get if you have used the ‘R’ version of Boot Resources in error; this will have only 16 Colours and the Resolution will be 640x256 pixels.

Uniboot.zip

The next pair of screenshots show what you will find if you open unibootW.zip (left) and unibootR.zip (right) within Windows. Note that the filetypes are present in the ‘W’ version.

RISC OS and Windows

The reason why the content of unibootR.zip doesn’t show the RISC OS filetypes when viewed in Windows is that the unibootR.zip has been created in RISC OS.

The golden rule for preserving filetypes is that if you compress in RISC OS then you must extract in RISC OS. If you compress in Windows then you must extract in Windows. If you copy and paste in Windows then filetypes will be preserved. If you copy and paste files from one RISC OS emulator to another then the filetypes will be preserved.

Difficulties arise only when, in the Windows environment, you extract and use files which have been compressed in RISC OS (or vice versa).

On the 4corn website at: http://www.4corn.co.uk you will find many interesting archives containing legacy software which was on the original Acorn website when it finally closed. All the zip archives on this 4corn site have been compressed from within RISC OS.

As my first example of filetype changes I shall consider the RISC OS 3.70 ROMs which can be downloaded from the 4corn website as the compressed file ‘riscos3_70.zip’.

If the ROMs are extracted within RISC OS using !SparkPlug then, when you look at the contents from within Windows you will see that the ‘,ffd’ filetype extension is included as shown in the screenshot below.

If the ROMs are extracted within Windows then, when you look at the contents wihin Windows, you will see that the file extensions are missing.

Have a look at the compressed size of ROM3 and you’ll see that using Windows compression it is slightly larger than the original ROMs compressed by 4corn within RISC OS. Fortunately, Red Squirrel doesn’t care whether the file extensions of the ROMs are included or not - but I am a pedant so I have asked you to add them manually. Now look back at the two screenshots for the uniboot.zip contents. As just one example of the contents, the !Boot file is displayed in Windows as either ‘!Boot’ or ‘!Boot,feb’ depending upon whether you are looking (in Windows) at the unibootR.zip from the 4corn site or unibootW.zip that I created using Windows to create the archive.

If unibootR.zip is expanded in Windows and the resulting files copied (in Windows) to the Hostfs.Disk370 folder then the filetype of this !Boot file will not be Obey but Text. This version of the Boot Resources (with the wrong filetypes) will not run properly. It produces a version of the emulator (see the earlier screenshot) which displays only 16 colours at a resolution of 640x256.

If the unibootW.zip (which I compressed in Windows) is expanded in Windows and the resulting files copied to the Hostfs.Disk370 folder, then the filetype of this !Boot file will be Obey. This version of the Boot Resources (with the filetypes correctly appended to the file names) does run properly and it produces the version of the emulator (see the earlier screenshot) which displays 256 colours at a resolution of 800x600.

The Bootstrap Problem

If you already have a RISC OS emulator running in Windows, even a ‘bare bones’ emulator such as this Red Squirrel emulator which you have built, then you can use this simple RISC OS emulator to extract files within RISC OS. Having extracted them within your simplest of emulators you can enter the Windows environment and, in Windows, copy and paste those files, complete with filetype extensions (such as ‘,feb’) to a different, more sophisticated emulator (e.g. RPCEmu) that you might be building. This simplest of emulators has become a tool which will help you to build another emulator more easily.

However, for many of you, this might be your first RISC OS emulator so you cannot use this method. If so then how can you overcome this ‘bootstrap’ problem?

Self Extracting SparkPlug

The answer is to use David Pilling’s self extracting SparkPlug. You can download version 2.26 as the second item down the page at: http://www.davidpilling.net/free.html.

Let us assume for my description of how to execute this ‘bootstrap’ operation that you do not have access to the !Boot which I created for you and compressed into ‘unibootW.zip’ but that you have access only to the ‘!Boot’ extracted from ‘unibootR.zip’, the !Boot which doesn’t work because all the filetype information has been lost.

Previously you created a folder within My Documents called Red Squirrel. Inside Red Squirrel you created a folder called Resources and another called TestBuild-01. Create a third folder and call it Tools. Download the self extracting SparkPlug into this Tools folder. The file is called ‘splug226.bas’; the file type is BASIC.

Now go to TestBuild-01.Hostfs.Disk370 (into which you loaded the !Boot which doesn’t work properly) and create a New Folder called Apps. Copy both ‘splug226.bas’ and ‘unibootR.zip’ into this Apps folder. You may have to change the file type of ‘splug226.bas’ to BASIC if it not already set to BASIC. Double click to run this file and you will be rewarded with a copy of !SparkPlug located in Apps. If you try to run this version of !SparkPlug then you will fail with an error message “System resources cannot be found”. Don’t be alarmed. We can fix this.

Hold down the key and double click on !SparkPlug to reveal its contents. Again, hold down and double click on !Run to open the !Run file in !Edit. You will see the screenshot below.

Now you have to edit this !Run file in order to ‘REM out’ (stop the execution of) the line containing this error message. In the screenshot find the blue RISC OS arrow. You will see that at the beginning of this line I have inserted a vertical hyphen (the REM command) just before the word “if”. This vertical hyphen will prevent that line being executed.

Save the modified !Run file.

Return to the Apps directory and double click on !SparkPlug. This time it will run and the SparkPlug icon will appear at the right hand side of the icon bar. Drag the archive called ‘unibootR’ to this icon and you will see the screenshot below. We’re on the last lap. Rename the unwanted !Boot as _Boot. Then drag the !Boot from within the ‘unibootR’ folder to the HardDisk folder. When you have done this then you will see the screenshot below. If you have succeeded then you can delete all the unwanted files and folders such as the unwanted ‘_Boot’ and the unwanted ‘unibootR’ compressed archive before returning to the ‘TestBuild’ folder and executing ‘RedSquirrel.exe’. This will load and run a fully functioning version of RISC OS 3.70 in the Red Squirrel Emulator.

Well Done! You have built a RISC OS 3.70 Emulator. Was this a ‘first time’ for you?

User Guide

Red Squirrel was the 2002 precursor of VirtualRPC-SA. As such, much of the content of “VirtualRPC in Use” is applicable to the Red Squirrel you have built. You can download a copy of this user guide as a PDF from http://www.virtualacorn.co.uk/support/vrpcinuse/ . You can download from the same URL a set of 12 supplements as a single PDF.

I suggest that, if you are going to use this D-I-Y version of Red Squirrel in earnest that you do read this user guide. You will discover, for example, that the way of exiting from full screen mode is to use rather than using the more usual Windows key, .

The version of Red Squirrel you have built does behave a little differently from VirtualRPC. For example the pointer in this D-I-Y version does behave more like a Windows pointer in that it can be moved freely outside the RISC OS window without the need to execute . The input focus for the white Windows pointer can be captured by the RISC OS window with a single click just as it is in any other Windows window. When you do this the pointer changes to the usual blue RISC OS pointer.

VirtualRPC is set up with 8MB of VRAM so it will support 16M colours at high resolution. Red Squirrel is limited to 2MB of VRAM so that high resolution is available only in 256 colours.

Upgrades

It is possible to upgrade this bare bones, D-I-Y Red Squirrel to RISC OS 4.02. I shall deal with that and describe how to install some other upgrades, such as increased RAM and higher resolutions, in another article. However, if you want to use a RISC OS emulator in more comprehensive ways than is possible using Red Squirrel I would suggest that you build a version of RPCEmu. I shall describe how to build RPCEmu in a future article.

Available Files

On the usual website you will find the Windows friendly version of ‘uniboot.zip’ which I have called ‘unibootW.zip’ (2.58MB).The second file called ‘TestBuild-01.zip’ (4.51MB), has been compressed in Windows and therefore it must be expanded in Windows. It contains the complete D-I-Y version of Red Squirrel which you have built by following the instructions in this article. The hardware emulator was frozen in 2002; the RISC OS 3.70 ROMs and the Uniboot Boot Resources are never going to change. All I have done is put these three components together just as you have done by following the instructions in this article. It can be used as a tool to expand folders which have been compressed in RISC OS but which need to be pasted within Windows so Save a copy within your ‘Tools’ folder. Bio-Bit

Recently Gerald bought a cheap Chinese clone remote control for his FujiFilm FinePix HS50EXR camera. This shot was his first test of that remote control. Pity about the top lighting!