Porting ARM BASIC to the Raspberry Pi via SDL 2.0

chat about arc/risc pc gaming & RISC OS software here (NOT the core OS!)

Related forum: adventures


Richard Russell
Posts: 163
Joined: Sun Feb 27, 2011 10:35 am

Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby Richard Russell » Sat Sep 03, 2016 5:08 pm

As many of you will know, I have recently ported my x86 (IA-32) version of BBC BASIC to Linux, Mac OS-X and Android by means of the SDL (Simple DirectMedia Layer) cross-platform library. To achieve this I have written, in C, an almost complete emulation of the BBC VDU drivers ('oswrch'), including MODE 7, and an emulation of the BBC star commands ('oscli') albeit that they are more closely based on those in BBC BASIC for Windows rather than Acorn's MOS or RISC OS.

To all intents and purposes the only major component of this cross-platform version of BBC BASIC which is CPU-specific is the interpreter itself! This raises an intriguing possibility: if I could link my SDL-based OS emulation to Sophie's ARM BASIC I could quite easily create a version which would run on the RPi, and indeed on other ARM platforms supported by SDL 2.0 such as Android.

Unfortunately, creating a linkable and relocatable version of ARM BASIC is not straightforward. There are two principal stumbling blocks: BASIC makes its calls into the OS via SWIs, which would have to be changed to conventional BL subroutine calls, and BASIC's RAM workspace is at a fixed memory address which would have to be made relocatable (in most, if not all, cases the workspace is accessed by register-relative addressing so this isn't as challenging as it might at first seem, and a modern assembler may be able to do much of the work).

My difficulty is that I'm not an ARM programmer so this adaptation to make BASIC linkable and relocatable isn't something I can do myself. Some preliminary work has already been done by David Boddie, which can be found at Github here (don't be misled by the name, there's nothing Android-specific); it uses as its starting point Jonathan Harston's enhanced BBC BASIC Plus.

My question is: would anybody be interested in collaborating with me on this project? If we can take forward David Boddie's work to create a linkable and relocatable version of ARM BASIC, the only remaining task will be to write some glue code (either in C or ARM assembler) to interface my existing SDL-based framework with the ABI that BASIC expects to see for its input-output etc. The end result would be a highly functional, fast, GUI version of BBC BASIC for the RPi with features that (for example) Brandy can't provide such as the embedded ARM assembler.

Richard.

Richard Russell
Posts: 163
Joined: Sun Feb 27, 2011 10:35 am

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby Richard Russell » Tue Oct 04, 2016 10:25 pm

Richard Russell wrote:My question is: would anybody be interested in collaborating with me on this project?

A month on and not a single reply. Is there really no interest in porting Sophie's BASIC to non-Acorn platforms like the RPi or Android? Or is it that there's interest, but nobody with the right skills to contribute to the project?

Richard.

dfeugey10
Posts: 34
Joined: Mon May 02, 2016 7:59 am
Contact:

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby dfeugey10 » Wed Oct 05, 2016 6:50 am

Hi Richard.
Of course, it's the second option, as I don't see why we would not want to attract new users :)
Nice work anyway. All my business projects are made with BBCB4W.

User avatar
flaxcottage
Posts: 2739
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby flaxcottage » Wed Oct 05, 2016 7:59 am

The interest is there, Richard. The skills, however, are severely lacking in my case, sorry. :? :(
- John

Currently running Level 4 Econet with BBC B, BBC B+ 128K, Master 128K, 4Mb A3000, 4Mb A3020, 4Mb A4000, 4Mb A5000 dual FDD; UK101; HP41CX setup; Psion 3a, 3mx and 5mx; Z88; TI-58c, TI-59 and printer, HP-16C programmer's calculator

User avatar
richardtoohey
Posts: 3361
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby richardtoohey » Sat Oct 08, 2016 12:43 am

flaxcottage wrote:The interest is there, Richard. The skills, however, are severely lacking in my case, sorry. :? :(
Same here. I'd like to learn the skills etc. but I'm already behind on every venture I promise to help out in, so can't help here. But definitely interested!

alex_farlie
Posts: 35
Joined: Sun Jul 07, 2013 9:46 pm

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby alex_farlie » Sat Oct 15, 2016 8:58 am

Had you tried asking over on Risc OS Open's forum? (There are a number of ARM programmers there, not that they'd want to work on a not quite RISC OS project.)

I'm not sure but someone (possibly Mr J.G. Harston) had also mentioned a while back about extending the Risc OS 5 ARM BBC basic under ROOL's version, to accommodate BB4W syntax extensions.

User avatar
sdsolle
Posts: 69
Joined: Sun Jun 08, 2014 1:57 am
Location: Hertfordshire
Contact:

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby sdsolle » Sat Jan 21, 2017 5:21 pm

Richard Russell wrote:
Richard Russell wrote:My question is: would anybody be interested in collaborating with me on this project?

A month on and not a single reply. Is there really no interest in porting Sophie's BASIC to non-Acorn platforms like the RPi or Android? Or is it that there's interest, but nobody with the right skills to contribute to the project?


Completely missed this at the time – did anyone with necessary skills ever get back to you?
Sean.

Richard Russell
Posts: 163
Joined: Sun Feb 27, 2011 10:35 am

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby Richard Russell » Sat Jan 21, 2017 6:29 pm

sdsolle wrote:Completely missed this at the time – did anyone with necessary skills ever get back to you?

Sadly not. Adapting Sophie's BASIC to be more portable doesn't seem to appeal to people with the right expertise, and to be fair the initial investigations by David Boddie revealed it to be a lot more work than I initially anticipated. Back in the 1980s Sophie doesn't seem to have given much consideration to the ARM CPU being used in non-Acorn platforms, which is somewhat ironic given what we know now, and didn't write ARM BASIC with portability in mind.

So I have been concentrating my efforts on my Linux (x86), Mac OS-X and Android versions of BBC BASIC, the next release of which is due at the beginning of next month. That doesn't mean I have entirely forgotten the Raspberry Pi, but that has unique challenges (not least that, as I understand it, SDL 2.0 doesn't play nicely with X and has to be run fullscreen).

What is your interest?

Richard.

Richard Russell
Posts: 163
Joined: Sun Feb 27, 2011 10:35 am

Re: Porting ARM BASIC to the Raspberry Pi via SDL 2.0

Postby Richard Russell » Tue Mar 28, 2017 10:32 pm

Richard Russell wrote:as I understand it, SDL 2.0 doesn't play nicely with X and has to be run fullscreen

It's bad form replying to one's own post, I expect, but I didn't want the thread to end with a misleading statement. Although the comment above is what I gathered from the SDL forum, in practice SDL 2.0 seems to run perfectly fine in windowed mode under X on the Raspberry Pi 3. It's rather slow, but that can be substantially remedied by enabling the 'experimental GL Driver' in raspi-config. If proof is needed, I've posted elsewhere on this forum a link to a YouTube video showing Dropperz running in BBC BASIC on an RPi 3 + Raspbian.

Richard.


Return to “software”

Who is online

Users browsing this forum: No registered users and 1 guest