BBC BASIC for SDL 2.0 version 1.20a released

for discussion of bbc basic for windows/sdl, brandy and more
Post Reply
Soruk
Posts: 892
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

BBC BASIC for SDL 2.0 version 1.20a released

Post by Soruk »

BBC BASIC for SDL 2.0 version 1.16a released

(Edit: While I'm copying Richard's announcements across, I will try to keep everything to one thread)

Richard has released version 1.16a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. This is an interim release to fix a bug and a regression, it affects the 64-bit, ARM and Browser editions only, the 32-bit x86 editions have not been updated:
  1. Fixed a bug affecting the ON ... PROC statement (it could report a Syntax Error when there was nothing wrong).
  2. Fixed a regression in the ellipse.bbc library (causing filled ellipses not to plot if the GCOL mode was OR, AND, XOR or invert).
This new version may be downloaded from the usual location. The GitHub repository has been updated.
Last edited by Soruk on Thu Mar 04, 2021 10:42 am, edited 4 times in total.
Matrix Brandy BASIC VI (work in progress)
Soruk
Posts: 892
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

BBC BASIC for SDL 2.0 version 1.17a released

Post by Soruk »

BBC BASIC for SDL 2.0 version 1.17a released

Richard has released version 1.17a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. The changes in this version are as follows:
  1. BASIC Interpreter / Run Time Engine

    Updated the in-browser (Emscripten / Web Assembly) edition to support shader graphics, 3D graphics and the Box2D physics engine.

    Fixed a subtle bug which could cause unwanted behaviour when using ON ERROR LOCAL in nested functions (ARM and 64-bit editions only).

    Fixed a one-byte buffer overrun in the *KEY command (ARM and 64-bit editions only).

  2. IDEs and Utilities

    Updated BBCEdit to version 0.37.1 (with thanks to Andy Parkes); amongst other changes this has a new light-mode option.

    Fixed a regression causing the profiler not to work on the Raspberry Pi (D'oh!).

  3. Libraries

    Added shaderlib.bbc to facilitate writing shader-based programs, and to aid compatibility with the in-browser edition.

    Added webgllib.bbc which is substantially compatible with ogllib and gleslib but uses shaders rather than the Fixed Function 3D Pipeline.

    Updated some other libraries to improve compatibility with, and performance in, the in-browser edition.

  4. Example Programs

    Modified Ceefax.bbc (again!) to track changes the BBC is making to its web pages and to improve performance in the in-browser edition.

    The shader-based programs (fluid.bbc, mandel.bbc, seascape.bbc, slitscan.bbc) have been re-written to use the shaderlib library.

    Updated some other example programs to improve compatibility with, and performance in, the in-browser edition.
This new version may be downloaded, for all the supported platforms, from the usual location. The GitHub repository has been updated (used to build the MacOS, Raspbian, Android, iOS, 64-bit Linux and in-browser editions, currently).

Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.
Last edited by Soruk on Mon Dec 07, 2020 1:18 pm, edited 1 time in total.
Matrix Brandy BASIC VI (work in progress)
Soruk
Posts: 892
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

BBC BASIC for SDL 2.0 version 1.18a released

Post by Soruk »

BBC BASIC for SDL 2.0 version 1.18a released

Richard has released version 1.18a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. The changes in this version are as follows:
  1. BASIC Interpreter / Run Time Engine

    Added a new command-line switch -borderless to remove the title bar.

    Extended the PTR() pseudo-variable (again) to accept a function or procedure name as a parameter.

    Fixed an obscure bug which could cause a star-command to crash if within 256 bytes of the end of a library!

  2. IDEs and Utilities

    Updated BBCEdit to version 0.37.2, which speeds up directory listings when there are many files.

    Modified SDLIDE to make the behaviour of Backspace more consistent, for example you can backspace through the line-number field.

  3. Libraries

    Added Svein's excellent pdflib library for creating PDF files (single A4 page only).

    Fixed a bug in aagfxlib causing 'dashed' lines to be sometimes drawn slightly too long.

    Modified box2dgfx, imglib, shaderlib and webgllib to clip to the current graphics viewport, if any.

  4. Example Programs

    Added saa505x.bbc in examples/tools, to demonstrate the different MODE 7 character sets.

    Added raytrace.bbc in examples/graphics, another shader demo from Shadertoy.com.

    Updated aagfxdem.bbc in examples/graphics, to check that 'dashed' lines are the right length.
This version may be downloaded, for all the supported platforms, from the usual location. The GitHub repository has been updated (used to build the MacOS, Raspbian, Android, iOS, 64-bit Linux and in-browser editions, currently).

Please remember that if you use the BBC2APK Android Application Generator you should download a new APK template to ensure that any updates to the run-time engine are incorporated in your own apps.
Matrix Brandy BASIC VI (work in progress)
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by Richard Russell »

I've released version 1.19a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. The changes in this version are as follows:
  1. BASIC Interpreter / Run Time Engine

    Extended the *DUMP command to accept optional hexadecimal start and end offsets (or length), using the same syntax as *LOAD and *SAVE.

  2. IDEs and Utilities

    Added a version check on startup (desktop editions only).

    Added the Macro recorder utility to customize the function (and tab) keys in SDLIDE, similar to the BB4W IDE.

    Fixed a couple of minor bugs in SDLIDE.bbc.

  3. Libraries

    Added menulib.bbc to support menu bars and drop-down menus (based on the SDLIDE menus).

    Added editbox.bbc which extends the dialogue-box support to include a multi-line edit control.

    Extended dlglib.bbc to include PROC_getdlgitemrect() and to distinguish between left and right mouse clicks.

    Extended filedlg.bbc to include FN_filedlgex() which supports dark mode and positioning of the file selector.

  4. Example Programs

    Added gorillas.bbc in examples/games, a conversion of one of David Williams's BB4W programs (requires SDL 2.0.6 or later).

    Added textedit.bbc in examples/general (desktop editions only) to demonstrate the use of menus and the multi-line edit control.
This version may be downloaded, for all the supported platforms, from the usual location. The GitHub repository has been updated (used to build the MacOS, Raspbian, Android, iOS, 64-bit Linux and in-browser editions, currently).

Important! iOS users: the certificate for your current version of BBC BASIC for SDL 2.0 expires soon. You should install version 1.19a in order to ensure continued operation. The new certificate will expire on 19th January 2022.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by Richard Russell »

Richard Russell wrote:
Fri Jan 22, 2021 2:15 pm
I've released version 1.19a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser.
For anybody who may be interested, I can confirm that the regular (x86-64) MacOS edition of BBC BASIC for SDL 2.0 appears to run reasonably well on an M1-based ('Apple silicon') Mac using Rosetta (the x86 emulation layer). No doubt a native AArch64 edition would run faster, but at least this means you can run BBC BASIC until such an edition is available.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
BigEd
Posts: 3934
Joined: Sun Jan 24, 2010 10:24 am
Location: West Country
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by BigEd »

Good to know!
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by Richard Russell »

BigEd wrote:
Sat Jan 30, 2021 9:03 am
Good to know!
And it looks as though it will be the only way to get BBC BASIC for SDL 2.0 running properly on the M1. The reason being that "Apple Silicon does not allow for RWX memory pages", that is, it will not let you allocate a block of memory which has Read, Write and Execute access - which is exactly what BBC BASIC needs for its heap if it is to support the assembler!

This is what Apple calls 'the Hardened Runtime' and whilst it's something that an Intel x86 app can opt into, it's enforced for all native Apple Silicon apps. Here we have yet another case of Apple imposing 'security' features on the end-user rather than letting him use his own judgement and deciding what degree of risk is acceptable.

The only workaround, and it's not something that BBC BASIC can realistically take advantage of, is to declare your app as using Just In Time (JIT) compilation. Even then you can only toggle memory pages between RW and RX, in just one thread, using an Apple-specific API.

So that kills the prospect of a native Apple M1 version of BBC BASIC having an assembler, which in turn kills the debugging and profiling capabilities of BBCSDL which rely on assembled code. If this is the way all OSes are going to go, BBC BASIC as we know it is doomed. :(
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
lurkio
Posts: 3397
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by lurkio »

Richard Russell wrote:
Fri Jan 22, 2021 2:15 pm
I've released version 1.19a of BBC BASIC for SDL 2.0
Good news! Thank you.

Btw, I notice that the colours displayed in the running-program window in BBCSDL are rather muted in comparison with the equivalent colours in BeebEm. See the example screenshots below.

Am I seeing the colours you intended me to see or am I doing something wrong?

Was the colour scheme a deliberate choice? If so, can I reconfigure it?

This isn't a complaint or an urgent request. I just noticed that some of the BASIC graphics demos I've been posting in another thread looked less vibrant in BBCSDL than in BeebEm, and I thought it might be nice if I could adjust the BBCSDL colour scheme somehow..?

:?:

Screenshot 2021-01-30 at 18.05.05.png
Screenshot 2021-01-30 at 18.03.30.png
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.19a released

Post by Richard Russell »

lurkio wrote:
Sat Jan 30, 2021 6:14 pm
Am I seeing the colours you intended me to see or am I doing something wrong?
It's very likely that what you're seeing is a side-effect of the absence of flashing colours in BBC BASIC for Windows and BBC BASIC for SDL 2.0 (without a hardware-paletted display, i.e. a Colour Look-Up Table such as the one in the BBC Micro's ULA, flashing colours are virtually impossible).

I wanted colour numbers 8-15 to do something useful, so in my BASICs they are intensified colours, with colours 1-7 being slightly reduced in intensity (so for example COLOUR 2 has RGB values of 00 C8 00 not 00 FF 00). I find the resulting colours quite bright enough, but they will seem slighted muted compared to those from BBC Micro emulators.

If you don't mind the code overhead, the simple solution is to redefine the palette:

Code: Select all

COLOUR 1,&FF,&00,&00
COLOUR 2,&00,&FF,&00
COLOUR 3,&FF,&FF,&00
COLOUR 4,&00,&00,&FF
COLOUR 5,&FF,&00,&FF
COLOUR 6,&00,&FF,&FF
COLOUR 7,&FF,&FF,&FF
or in a single VDU statement:

Code: Select all

VDU 19,1,16,&FF,&00,&00,19,2,16,&00,&FF,&00,19,3,16,&FF,&FF,&00,19,4,16,&00,&00,&FF,19,5,16,&FF,&00,&FF,19,6,16,&00,&FF,&FF,19,7,16,&FF,&FF,&FF
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

BBC BASIC for SDL 2.0 version 1.20a released

Post by Richard Russell »

I've released version 1.20a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android, iOS and in-browser. The changes in this version are as follows:
  1. BASIC Interpreter / Run Time Engine

    Fixed FOR...NEXT loops misbehaving with negative non-integer STEP on ARM editions (Raspberry Pi, Android, iOS).

    Fixed *KEY not correctly handling strings such as |!|H (ARM and 64-bit editions only).

  2. IDEs and Utilities

    Fixed compiler.bbc incorrectly crunching structure members in rare circumstances.

    Fixed SDLIDE.bbc crashing in MacOS if the Tab key was pressed.

  3. Libraries

    Modified webgllib.bbc to be 64-bit compatible (it can be used on platforms other than in-browser).

    Modified filedlg.bbc so that you can type a full (absolute) path into the File name box.

    Modified menulib.bbc so that drop-down menus can be hidden from the menu bar (by setting their title to an empty string).

    Fixed editbox.bbc not reliably setting the 'changed' flag, and mispositioning the caret on blank lines.

  4. Example Programs

    Modified Ceefax.bbc to add function key shortcuts (f1-f4) for the coloured buttons; also fixed a crash if a page number with a leading zero was entered.

    Modified sudoku.bbc so the timeout only applies to the 'Count' option, not to 'Solve', so it can solve any puzzle even on slow machines.
This version may be downloaded, for all the supported platforms, from the usual location. The GitHub repository has been updated (used to build the MacOS, Raspbian, Android, iOS, 64-bit Linux and in-browser editions, currently).
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.20a released

Post by Richard Russell »

Richard Russell wrote:
Thu Mar 04, 2021 9:31 am
Modified webgllib.bbc to be 64-bit compatible (it can be used on platforms other than in-browser).
That is perhaps worth emphasising. webgllib.bbc was written to support 3D graphics in the in-browser edition of BBCSDL, because WebGL doesn't have the Fixed Function Pipeline (in OpenGL and OpenGL ES) that the other editions rely on. To make it work it was necessary to use shaders instead (and I was pleased to be able to achieve that, despite a very limited experience of shader programming).

It was only after I'd got it going that I realised that it actually worked better than the other libraries (ogllib.bbc and gleslib.bbc) in that lighting calculations are performed per pixel rather than per vertex. This can dramatically improve the realism of the end result, especially in cases when spotlights are used, and/or there are specular reflections.

Fortunately not only does it work better in those respects, it runs on all the other platforms (Windows, MacOS, Linux, Raspbian, Android, iOS) too! So if you want to take advantage of the improved rendering quality simply INSTALL webgllib instead of ogllib. It's not quite 100% compatible but it comes close (you'll notice a particularly dramatic effect if you perform the substitution in skaters.bbc!).
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
User avatar
Richard Russell
Posts: 2139
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: BBC BASIC for SDL 2.0 version 1.20a released

Post by Richard Russell »

Richard Russell wrote:
Thu Mar 04, 2021 10:53 pm
Fortunately not only does it work better in those respects, it runs on all the other platforms (Windows, MacOS, Linux, Raspbian, Android, iOS) too!
Note that the webgllib library's use of shaders seems to interfere with the normal operation of SDL 2.0, so that if you CHAIN another program or return to immediate mode you can end up with a black screen (it is still responding to input, but invisibly). This isn't normally important on a desktop platform, when it is usual to close the window in which the program was running anyway. But on Android and iOS it can mean that after running a program which uses webgllib you may need to fully-close and re-open the BBC BASIC app.
I am suffering from 'cognitive decline' and depression. If you have a comment about the style or tone of this message please report it to the moderators by clicking the exclamation mark icon, rather than complaining on the public forum.
Post Reply

Return to “modern implementations of classic programming languages”