Raspberry BASIC

Raspberry BASIC => Interpreters => BBC BASIC => Topic started by: Richard Russell on August 30, 2020, 07:06:52 PM

Title: New: In-browser BBC BASIC for SDL 2.0
Post by: Richard Russell on August 30, 2020, 07:06:52 PM
I've built an experimental in-browser (WebAssembly) edition of BBC BASIC for SDL 2.0 which will currently run in Microsoft Edge and Google Chrome (but not Firefox).  It can be run directly from this link (https://www.bbcbasic.co.uk/bbcsdl/wasm/bbcsdl.html).

There are a number of demo programs included which can be found in the examples/games, examples/general, examples/graphics and examples/sounds directories.  For example:

Code: [Select]
*cd examples/graphics
CHAIN "bounce"

There are some significant limitations, the most serious of which is probably that the GCOL 'logical plotting' modes (AND, OR, EOR) don't work; this is because webgl does not support these operations.  Another limitation is that the SYS statement is not supported.  It's also quite slow!

Currently there is no way to load in your own program(s), that needs to be thought about.  Also, the local filesystem provided by Emscripten is volatile and anything saved there will be lost when you close the browser.
Title: Re: New: In-browser BBC BASIC for SDL 2.0
Post by: Richard Russell on August 31, 2020, 09:29:39 AM
There are some significant limitations, the most serious of which is probably that the GCOL 'logical plotting' modes (AND, OR, EOR) don't work

To address this, in part, I have arranged that rather than the logical plotting modes being completely non-functional they activate the nearest supported webgl blend mode.  So for example GCOL 1 sets 'add' and GCOL 2 sets 'multiply'; whilst these obviously have significantly different effects from the genuine logical modes (OR and AND), they are equivalent in the special case when the RGB values of the source and destination are all 0.0 (&00) or 1.0 (&FF).

The updated version can be run, as before, from this link (https://www.bbcbasic.co.uk/bbcsdl/wasm/bbcsdl.html); it will only work in Microsoft Edge or Google Chrome.  You may have to clear your browser cache to guarantee picking up the new version.

To demonstrate the newly-implemented GCOL modes I have added polydots.bbc in the examples/graphics directory, which didn't work previously because it relies on GCOL 3,15.
Title: Re: New: In-browser BBC BASIC for SDL 2.0
Post by: Richard Russell on September 07, 2020, 11:02:14 AM
I have updated the in-browser edition of BBC BASIC for SDL 2.0 (https://www.bbcbasic.co.uk/bbcsdl/wasm/bbcsdl.html) to version 1.14y.  The differences in this version are:


Users of 32-bit Windows please note that a few of the supplied programs do not work properly, seemingly because of a bug in the 32-bit WebGL.