BBC BASIC for SDL 2.0 version 1.15a released

for discussion of bbc basic for windows/sdl, brandy and more
Post Reply
Deleted User 9295

BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

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

    Added the PTR()= syntax to set the pointer of a structure, array or string.

    Extended =PTR() to return the pointer of a structure or array as well as a string.

    Added = SYS("function") to return the address of an API function, or zero if it doesn't exist.

    Added support for @cmd$ possibly being longer than 255 bytes.

    Changed TIME from unsigned to signed, since code like 'T% = TIME' is very common.

    Fixed a minor problem with the 'pending newline' mode (VDU 23,16,1|) (needs fixing in BB4W too!).

    Fixed a bug (in the 64-bit and ARM editions only) causing assigning a string to a numeric variable not to result in the expected 'Type mismatch' error.

  2. IDEs and Utilities:

    SDLIDE: Implemented breakpoints, very similar to those in LBB and bbcide (double-click in the left margin to add or remove a breakpoint).

    SDLIDE: Enabled the Print option in the File menu and toolbar. This prints the current program to the default printer.

  3. Libraries:

    Modified filedlg to fix an incompatibility with *HEX 64 mode.

    Modified dlglib to reduce CPU usage when idling, especially when a List Box has the input focus.

    Modified socklib to prevent a 'double-free' error if PROC_exitsockets is called twice.

  4. Example Programs:

    Modified Ceefax.bbc to recognise the word Thunder in the weather description and display the 'storm' indication.

    Modified telstar.bbc to include 'ANSItex BBS' in the list of services, and to disable 'pending newline' mode.
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, iOS, 64-bit Linux and in-browser editions, currently).
Soruk
Posts: 1136
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Soruk »

Richard Russell wrote: Fri Sep 11, 2020 5:16 pm Fixed a minor problem with the 'pending newline' mode (VDU 23,16,1|) (needs fixing in BB4W too!).
Out of curiosity, what was the issue?
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Deleted User 9295

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

Soruk wrote: Sun Sep 13, 2020 12:21 pm Out of curiosity, what was the issue?
It's quite obscure. This program will demonstrate it, if present:

Code: Select all

   10 MODE 7
   20 VDU 23,16,1|
   30 
   40 DIM x%(13), y%(13)
   50 
   60 FOR c% = 8 TO 13
   70   PRINT TAB(0,3) STRING$(40,"x");
   80   VDU c%
   90   x%(c%) = POS : y%(c%) = VPOS
  100 NEXT
  110 
  120 CLS
  130 @% = &904
  140 FOR c% = 8 TO 13
  150   READ X%, Y%
  160   PRINT x%(c%), y%(c%) "  (should be ", X%,Y% ")"
  170 NEXT
  180 
  190 DATA 39,3, 1,4, 40,4, 40,2, 0,0, 0,3
ARM BASIC (I know it's the OS not BASIC responsible!) and BBCSDL (now) give the expected results, but previously BBCSDL was reporting 0,4 rather than 1,4 for the second test.

vdu2316.png
Deleted User 9295

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

In case of TL;DR can I draw attention to the two main new features in SDLIDE, printing and breakpoints:

Printing
The Print option in the File menu and the Print button in the toolbar are now active. They both result in the current program (as displayed in the editing pane) being listed on your default printer. SDLIDE gives no control over layout, font etc. but your Operating System should provide a way of configuring the default printing options, either at a command prompt or via a GUI.

Breakpoints
You can set (or clear) a breakpoint on a program line by double-clicking in the left margin, pressing Ctrl+B or using the Run... Toggle Breakpoint menu option. When such a breakpoint is set, the program will pause on that line (if it is ever executed) when run in Debug mode; breakpoints have no effect if the program is run 'normally'.

In the paused state you can examine variables, stop the program, run to the next breakpoint (if any) or single-step execution (Step Into or Step Over); adding or removing breakpoints will have no effect until the next time the program is run. You can clear all breakpoints by pressing F4 or using the Run... Clear Breakpoints menu option.
Soruk
Posts: 1136
Joined: Mon Jul 09, 2018 11:31 am
Location: Basingstoke, Hampshire
Contact:

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Soruk »

Richard Russell wrote: Sun Sep 13, 2020 2:28 pm
Soruk wrote: Sun Sep 13, 2020 12:21 pm Out of curiosity, what was the issue?
It's quite obscure. This program will demonstrate it, if present:
Thank you. As I suspected, Matrix Brandy also has a bug in that, the second one came out as 0, 4 instead of 1, 4. Now I know what I'll be doing this evening once the small monster is in bed!
Edit: Fixed!
Matrix Brandy BASIC VI (work in progress) The Distillery (another work in progress) Note Quiz (New educational software for the BBC and modern kit)
BBC Master 128, PiTubeDirect (Pi 3B), Pi1MHz, 5.25+3.5in dual floppy.
Deleted User 9295

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

If you've noticed some Ceefax pages not displaying correctly recently, you're not alone. The BBC has changed the HTML format of some of its news pages and this has broken the parser in Ceefax.bbc. I've now fixed this and updated both BBC BASIC for SDL 2.0 and the standalone Android app, although it's always going to be a case of catch-up as the BBC is bound to change things again. :(

ceefax195.png
Deleted User 9295

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

With the portfolio of 'my' versions of BBC BASIC now being quite large I have created this grid showing which version has which capabilities. The boxes marked ? indicate features of which the version is theoretically capable, but I haven't yet attempted an implementation:

feature_table.png
User avatar
jgharston
Posts: 5319
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by jgharston »

Richard Russell wrote: Mon Sep 14, 2020 5:59 pm If you've noticed some Ceefax pages not displaying correctly recently, you're not alone. The BBC has changed the HTML format of some of its news pages and this has broken the parser in Ceefax.bbc. I've now fixed this and updated both BBC BASIC for SDL 2.0 and the standalone Android app, although it's always going to be a case of catch-up as the BBC is bound to change things again. :(
I can't find where somebody asked about it, but with my copy of Ceefax.bbc I've done the following tweek which lets you use the "colour keys" f1-f4 for the four fastext-like coloured links.

In DEF PROCtimer at the end of the CASE key$ OF structure change to:

Code: Select all

        WHEN CHR$130,CHR$9: Page% = 100 : Auto% = FALSE : Abort% = TRUE
        WHEN CHR$145,CHR$27: PROCback
        WHEN CHR$146,CHR$132,CHR$128: PROCprev
        WHEN CHR$147,CHR$133,CHR$129: PROCnext
        WHEN CHR$148,CHR$131,CHR$32: Auto% = TIME
        WHEN CHR$13,CHR$136,CHR$137,CHR$138,CHR$139: PROCnavigate(ASCkey$)
Now I can slot my teletext terminal function key strip on my keyboard. :)

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.45
(C) Copyright J.G.Harston 1989,2005-2024
>_
Deleted User 9295

Re: BBC BASIC for SDL 2.0 version 1.15a released

Post by Deleted User 9295 »

jgharston wrote: Fri Feb 12, 2021 8:39 amI've done the following tweek which lets you use the "colour keys" f1-f4 for the four fastext-like coloured links.
I'm happy to add that functionality (F1 already works in the original).
Post Reply

Return to “modern implementations of classic programming languages”