BBC BASIC for SDL 2.0 version 1.18a released

New releases of BB4W and BBCSDL, and other updates, will be announced here
RichardRussell

BBC BASIC for SDL 2.0 version 1.18a released

Post by RichardRussell »

(I am well aware that these posts anger some members of this forum, because they consider BBC BASIC for SDL 2.0 to be irrelevant. I apologise for once again causing annoyance, but the number of places where I can legitimately post this information is diminishing all the time.)

I've 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.
RichardRussell

Re: BBC BASIC for SDL 2.0 version 1.18a released

Post by RichardRussell »

I have a feeling I've listed this code before, but either way it illustrates a trivial use of the extension to the PTR() pseudo-variable in BBCSDL v1.18a:

Code: Select all

      PROC0
      PTR(PROC0) = PTR(PROC1)
      PROC0
      PTR(PROC0) = PTR(PROC2)
      PROC0
      END
      
      DEF PROC0 : ENDPROC
      DEF PROC1 : PRINT "One" : ENDPROC
      DEF PROC2 : PRINT "Two" : ENDPROC
DDRM

Re: BBC BASIC for SDL 2.0 version 1.18a released

Post by DDRM »

Hi Richard,

Thanks for the update. Please feel no disquiet about posting BBC SDL material here: it clearly lies within the scope of this forum (anyone who disagrees should look in the top left corner....).

Best wishes,

D
RichardRussell

Re: BBC BASIC for SDL 2.0 version 1.18a released

Post by RichardRussell »

DDRM wrote: Sat 05 Dec 2020, 10:37Please feel no disquiet about posting BBC SDL material here: it clearly lies within the scope of this forum
I know it lies within the scope of the forum as currently described, but in practice I don't think any forum members (at least active ones) use BBCSDL or have any real interest in it. I'd suggest changing the title back to just BB4W, but I recollect it being tricky to create that bitmap (with the necessary transparency to make it blend in with the graded background) so it's not very practical.
RichardRussell

Re: BBC BASIC for SDL 2.0 version 1.18a released

Post by RichardRussell »

Here's a little test of the speed improvement possible by calling an API function by address (numeric) rather than by name (string), which is made simpler by the SYS() function added in v1.15a:

Code: Select all

      r%% = @memhdc%
      TIME = 0
      FOR I% = 1 TO 10000
        SYS "SDL_RenderDrawLine", r%%, RND(600), RND(500), RND(640), RND(500)
      NEXT
      t1% = TIME

      s%% = SYS("SDL_RenderDrawLine")
      TIME = 0
      FOR I% = 1 TO 10000
        SYS s%%, r%%, RND(600), RND(500), RND(640), RND(500)
      NEXT
      t2% = TIME

      CLS
      PRINT "Time taken for string SYS  = ";t1% " cs"
      PRINT "Time taken for numeric SYS = ";t2% " cs"
On this PC there's about a ten-times speedup.