This looks at the processes necessary to convert 48 Hours, a BBC micro BASIC program, to run natively on the Raspberry Pi under RISCOS.

48 Hours is a typical program that uses high resolution graphics written for the BBC micro. The program runs in MODE 1 and is too large to load and run from disc and therefore needs to be loaded into memory and then moved down in memory so that PAGE is at &E00. The program also loads the company logo directly into screen memory and loads a data file into memory at HIMEM, which is set at &2C60. This memory from &26C0 is used to provide the drawing data for the map of England, Scotland and Wales.

To help in saving memory all the user defined characters needed by the program are defined in the menu program that loads the 48 Hours program.

The program uses VDU19 ... to change the values for the logical colours used by MODE 1.


Conversion was carried out in the following steps;

  1. On a BBC micro a short program was written to *LOAD the logo onto the screen. This program then scanned the screen using the POINT x,y command to find the colour of each point along a line y units up the screen. The x,y coordinates and the colour value were written in sequence to another file. This process was repeated for all the lines taken up by the logo. The new file created could now be read by a procedure in RISCOS three bytes at a time and the bytes used to change the colour to the correct RISCOS colour number and then issue a PLOT69,x,y command. This process recreated the program logo as though it had been *LOADed onto the screen. RISCOS displayed the logo almost instantly.

  2. The file MAP2 on the disc was *LOADed above HIMEM on the BBC and then peeked to get the map drawing data. Instead of using this method in RISCOS, the map display procedure was modified to read the data directly from MAP2. The map display was almost instant, far quicker than on the BBC, and the program ran better for that.

  3. The user character definitions were moved from the menu program and placed in a subroutine at the end of the 48 Hours program. This was acceptable because RISCOS is not limited by memory.

  4. The character code for the sign was changed.

  5. The original BBC program made extensive use of VDU19 to change the logical colour values. These do not work in RISCOS. Accordingly variables Black%, Red%, Green%, etc. were declared and given the correct values. All VDU19 commands were changed to fit the RISCOS colour scheme. For example the VDU19,1,2,0;0;19,0,4,0;0; instructions were changed to COLOUR Green%:COLOUR(128+Blue%) so that the screens would display correctly.

  6. VDU23 commands to turn the cursor on and off were replaced with the RISCOS BASIC keywords ON and OFF respectively. VDU4 in RISCOS always turns the cursor back on and so had to be followed by OFF.

  7. The error trapping was changed. In the original program any errors, Escape or Break would re-RUN the program. To fit into the RISCOS menu system error trapping was changed to ON ERROR ONERROR OFF:IF ERR=17 THEN CHAIN"$.CAL.PIMENU" ELSE REPORT:PRINT" at line ";ERL:END. The result of this is that an error will halt the program and report what it is unless the error is 17, the Escape key has been pressed, and this will load the main CAL menu. Escape can then be used to jump out of the program. This is common to all programs in this project.


2018 - 2022 flaxcottage.com