BBC BASIC
« BBC BASIC for Linux (86) v0.07a »

Welcome Guest. Please Login or Register.
Feb 20th, 2017, 12:40am


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: BBC BASIC for Linux (86) v0.07a  (Read 484 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 358
xx BBC BASIC for Linux (86) v0.07a
« Thread started on: Jan 7th, 2016, 11:03pm »

Should anybody be interested, BBC BASIC for Linux (86) version 0.07a is now available for download from the usual place. This contains the changes that were necessary to make it work under Android (86), most importantly switching OpenGL from single-buffering (which seems not to be supported in Android/SDL) to double-buffering.

This change had a number of significant consequences, not least revealing a very nasty bug in SDL 2.0.3 (which, on investigation, proved to be a known issue). I've had to incorporate a very ugly workaround for this bug, which will break if and when the bug is fixed (it would appear not to have been fixed in SDL 2.0.4).

Version 0.07a has not been extensively tested in Linux so apologies in advance if something which used to work no longer does. Please let me know if that is the case.

Richard.
User IP Logged

jbk
New Member
Image


member is offline

Avatar




PM


Posts: 9
xx Re: BBC BASIC for Linux (86) v0.07a
« Reply #1 on: Jan 8th, 2016, 1:49pm »

thank you Richard
User IP Logged

RajivTyagi
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: BBC BASIC for Linux (86) v0.07a
« Reply #2 on: Sep 16th, 2016, 10:13am »

I use Ubuntu Linux 16.04. But after trying out many solutions, I selected BBC4WDEMO and used it with Wine to create a graphical application consisting of a radar screen that takes serial input from a COM port and some parallel connectivity with a radar simulator.

Then I discovered BBCSDL for Linux, thinking a native Linux app would run faster. To my horror, BBCSDL for Linux, apart from no longer supporting the serial port in either the Win format (COMx) or the Linux format (/dev/ttyS0), does not support the Inpout32 library as well.

The graphics commands have changed as well, while there isn't any documentation for the SDL library as implemented in the version. After finally getting the interpreter to work, I found my program running about half as fast as the bbc4wdemo.

Is there a place where I can work out how to use the serial and parallel ports? And the SDL graphics commands?

Sincerely,
Rajiv

on Jan 7th, 2016, 11:03pm, Richard Russell wrote:
Should anybody be interested, BBC BASIC for Linux (86) version 0.07a is now available for download from the usual place. This contains the changes that were necessary to make it work under Android (86), most importantly switching OpenGL from single-buffering (which seems not to be supported in Android/SDL) to double-buffering.

This change had a number of significant consequences, not least revealing a very nasty bug in SDL 2.0.3 (which, on investigation, proved to be a known issue). I've had to incorporate a very ugly workaround for this bug, which will break if and when the bug is fixed (it would appear not to have been fixed in SDL 2.0.4).

Version 0.07a has not been extensively tested in Linux so apologies in advance if something which used to work no longer does. Please let me know if that is the case.

Richard.
smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 358
xx Re: BBC BASIC for Linux (86) v0.07a
« Reply #3 on: Sep 16th, 2016, 11:29am »

on Sep 16th, 2016, 10:13am, RajivTyagi wrote:
To my horror, BBCSDL for Linux, apart from no longer supporting the serial port in either the Win format (COMx) or the Linux format (/dev/ttyS0), does not support the Inpout32 library as well.

I don't think that's entirely fair, because you are comparing a mature product (BBC BASIC for Windows) with a work-in-progress development (BBCSDL) which is barely at an 'alpha' release stage and isn't mentioned anywhere on my website!

Having said that, even a fully-developed SDL 2.0-based version of BBC BASIC isn't going to be able to support access to serial ports in a cross-platform way, because SDL 2.0 itself doesn't provide such support. Nevertheless there should be no reason why you cannot open a serial port using the Linux-style /dev specification, albeit that you would have to set parameters such as baud rate in your own code.

And of course there's no way a Windows DLL like inpout32 could ever run in native Linux; the same applies to any BBC BASIC library which is dependent for its operation on a Windows DLL.

Quote:
The graphics commands have changed as well

Not really. The graphics commands in BBCSDL, as in BB4W, are as close a match to the original BBC Microcomputer and Acorn Archimedes commands as it is practical to make them. You will find that the graphics example programs supplied with BBCSDL are either identical, or nearly so, to the equivalent examples supplied with BB4W.

If there is a specific difference you have noticed please tell us the particular statement you are using and what the difference is.

Quote:
while there isn't any documentation for the SDL library as implemented in the version.

I have asked here before, at least twice, for help in creating documentation, libraries and utilities for BBCSDL. I do not have the time, inclination or ability to do everything myself, and BBCSDL is totally dependent on volunteer effort to progress from its current state.

Quote:
I found my program running about half as fast as the bbc4wdemo.

The BBC BASIC interpreter itself, of course, is basically the identical code in BB4W and BBCSDL so will run at virtually the same speed (any differences being due to subtleties like code alignment). However Operating System features like file handling and graphics are inevitably quite different: in one case using Wine as the interface layer between my code and Linux, and in the other case SDL.

As I have demonstrated previously, BBCSDL can run significantly faster than BB4W, for example the FERN graphics demo typically runs about twice as fast. But the relative speed will depend very much on the detail of what your program happens to do.

Richard.
« Last Edit: Sep 16th, 2016, 11:54am by Richard Russell » User IP Logged

RajivTyagi
New Member
Image


member is offline

Avatar




PM


Posts: 2
xx Re: BBC BASIC for Linux (86) v0.07a
« Reply #4 on: Sep 16th, 2016, 12:54pm »

Thank you very much for the prompt and detailed response, Richard. It's after office hours here in India. But I will send you my code tomorrow. Running it in BBCSDL will show the various errors that result. The code is very much work in progress so you will find the display a little awry on account of logical errors, but the code runs without syntax errors in BBC4WDEMO.

Successively commenting out lines reported with errors by BBCSDL, removes functionality but finally begins running the code...

Sincerely,
RT
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 358
xx Re: BBC BASIC for Linux (86) v0.07a
« Reply #5 on: Sep 16th, 2016, 3:05pm »

on Sep 16th, 2016, 12:54pm, RajivTyagi wrote:
Running it in BBCSDL will show the various errors that result.

Just to reiterate that BB4W and BBCSDL share the same BBC BASIC interpreter so as far as 'pure BASIC' code is concerned the compatibility is 100%. Of course once one moves outside the realm of BASIC into OS-dependent features then they aren't, and can never be, fully compatible.

It's best not to think of BBCSDL to be in some way a development of BB4W, it isn't. They are both implementations of the BBC BASIC language but for completely different platforms: MS Windows in one case and SDL 2.0 in the other. Writing programs that will run on both is possible (the three 'IDEs': touchide.bbc, BBCEdit.bbc and SDLIDE.bbc are examples) but requires a very different approach from writing programs for BB4W.

So whilst I'm happy to see your program I'm not able to provide a 'conversion service', if that was your hope.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls