In-browser BBC BASIC for SDL 2.0

New releases of BB4W and BBCSDL, and other updates, will be announced here
mikeg
Posts: 101
Joined: Sat 23 Jun 2018, 19:52

Re: In-browser BBC BASIC for SDL 2.0

Post by mikeg »

Sadly Apple forbid programming languages in the App Store, as you know.
So have you made any applications for the App Store? If not a programming language then perhaps something else?
Focus is on code subject. Feel free to judge the quality of my work.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

mikeg wrote: Wed 07 Oct 2020, 04:48 So have you made any applications for the App Store? If not a programming language then perhaps something else?
No, I don't write mobile apps (and I don't use Apple products!).

My own mobile devices are Android, and the only 'standalone' apps I've created have been BBC BASIC programs made into APKs using BBC2APK. That doesn't create Play Store-compatible apps,
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

I've added the final 'missing' feature to the in-browser edition of BBC BASIC: the Box2D physics engine! You can now run all the physics demos in a suitable desktop browser (Chrome, Edge, Firefox or Opera):
I think I can claim that the in-browser edition is now substantially 'complete'. :)
Soruk
Posts: 23
Joined: Mon 30 Jul 2018, 20:24

Re: In-browser BBC BASIC for SDL 2.0

Post by Soruk »

RichardRussell wrote: Thu 15 Oct 2020, 18:24 I think I can claim that the in-browser edition is now substantially 'complete'. :)
Congratulations!
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

Soruk wrote: Thu 15 Oct 2020, 22:50 Congratulations!
The one annoying feature is that I can't find any way to switch back to normal 2D (SDL) operation after having done 3D rendering. Currently all the 3D example programs require you to reload the page (e.g. press F5) on completion, to recover access to the program menu / IDE. :(

In the webgllib library I restore everything I can to the state it had on entry, but despite that all I get on switching back to 2D is a black screen. BASIC is evidently still running, I can even change the size of the window, but nothing is visible.

This doesn't happen on desktop platforms, even when using webgllib; it seems to be specific to running in a browser. I'm assuming this is because SDL2 itself is using shaders and somehow my emulation of the Fixed Function 3D Pipeline is interfering with this. But oddly enough the 2D shader demos don't cause the problem, only the 3D ones do.

I'd really like to find a solution to this but I don't know what else to try.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

You can now run the in-browser edition of BBC BASIC in Chrome on Android, although you must first enable an 'experimental' feature. To do that start Chrome and visit chrome://flags#enable-webassembly-threads. This will find the WebAssembly threads support feature which you must enable using the drop-down selection box.

Once enabled you will be able to run BBC BASIC by visiting https://wasm.bbcbasic.co.uk/bbcsdl.html.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

RichardRussell wrote: Sun 18 Oct 2020, 21:59 You can now run the in-browser edition of BBC BASIC in Chrome on Android
Running in a browser on Android raises an interesting issue: the Back button isn't available to substitute for Escape (as it is in the native Android edition) because it must retain its usual browser function. So programs that rely on the Escape functionality (an example is SkyBaby which uses it to return to the main screen) can't be used properly in that environment.

I'm not sure how this can best be tackled. I could overlay a 'soft' button in the corner as I do in iOS, but one wouldn't want to do that when running in a desktop browser and I don't know how to detect that it's running on a touchscreen device.
mikeg
Posts: 101
Joined: Sat 23 Jun 2018, 19:52

Re: In-browser BBC BASIC for SDL 2.0

Post by mikeg »

An idea has recently crossed my mind about In browser BBC Basic for SDL and other web sites that interact with a mac or any other device.
If I am correct, your web site (when using drop box) takes the data from the drop box ( the program) and allows the information to be processed within the browser. I believe the key is what the difference is between what an interactive site does and what the enscripten does.

So what I am seeing on my mac is an "exception" message, which likely means that something within the host software is literally looking for a mac presence and then giving that statement.

Not saying that it is important to change anything, but perhaps that may hold a clue to what is happening. Why do interactive sites work with a mac? I think there is something within enscripten that is catering to mac and any device that has such exceptions.

There is many examples of web sites that have interactivity and that use all of the powers of interactivity within a mac.

Any ideas on this? ( I am not asking to hack the enscription software, but it seems that an exception could be worked around.)
Focus is on code subject. Feel free to judge the quality of my work.
RichardRussell

Re: In-browser BBC BASIC for SDL 2.0

Post by RichardRussell »

mikeg wrote: Sun 25 Oct 2020, 22:44So what I am seeing on my mac is an "exception" message
What browser are you using? The simplest explanation for an error message is that you're using an unsupported browser (e.g. Safari).
which likely means that something within the host software is literally looking for a mac presence and then giving that statement.
Before advancing a conspiracy theory, try a different browser, e.g. Vivaldi which I'm told runs nicely on a Mac.
Any ideas on this?
I suspect you're overthinking it. The simplest explanation is usually the right one, and if you're using Safari (which is after all the most common browser on Macs) there's no need to look any further. Browsers which I know to be compatible with BBC BASIC are desktop versions of Brave, Chrome, Edge, Firefox, Opera and Vivaldi, plus the Android version of Chrome if you enable the experimental feature as I described elsewhere.

As for why Safari doesn't support the necessary features to permit BBC BASIC to run you would have to ask Apple. Safari has always been relatively incompatible with other mainstream browsers.
mikeg
Posts: 101
Joined: Sat 23 Jun 2018, 19:52

Re: In-browser BBC BASIC for SDL 2.0

Post by mikeg »

[quoteWhat browser are you using? ][/quote]

I was using google.. I am using a Macbook pro( 2.4 Ghz Intel Core 2 Duo Mac Os X Version 10.6.8
It appears Vivaldi doesn't work on my device. It downloaded but wont operate in my system. (google indicates that support is no longer provided but it still works)
I am looking to convert the device to Windows 10 operating system. The process is a bit tedious, but in the day I spent $1500 CAN to buy the device so its probably worth doing so.
Focus is on code subject. Feel free to judge the quality of my work.