Raspberry BASIC

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Richard Russell

Pages: [1] 2 3
1
BBC BASIC / BBC BASIC for SDL 2.0 version 1.17a released
« on: October 23, 2020, 01:48:51 PM »
I've 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:

  • 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).

  • 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 bug causing the profiler not to work on the Raspberry Pi (D'oh!).

  • 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.

  • 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.

2
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« on: September 12, 2020, 02:44:02 PM »
I have updated the Console Mode editions of BBC BASIC to version 0.26, principally to bring them into line with the latest release of BBC BASIC for SDL 2.0.  The main changes in this version are:
  • File pointers and lengths (PTR#, EXT#) are now 64-bits on all platforms.
  • Added the SYS function to return the entry point of an API, e.g. `memcpy` = SYS("memcpy").
  • Added the PTR()= statement to set the pointer of an array or structure.
  • Extended the =PTR() function to return the pointer of an array or structure.
A typical use for the PTR()= statement is to set the pointer of a linked-list node:

Code: [Select]
      DIM node{link, ...}
      ...
      REPEAT
        PTR(node{}) = node.link : REM traverse linked-list
      UNTIL node.link = 0

Version 0.26 may be downloaded as follows:

3
BBC BASIC / BBC BASIC for SDL 2.0 version 1.15a released
« on: September 11, 2020, 04:19:59 PM »
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:
  • 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.

  • 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.

  • 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.

  • 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).

4
BBC BASIC / Re: New: In-browser BBC BASIC for SDL 2.0
« on: September 07, 2020, 11:02:14 AM »
I have updated the in-browser edition of BBC BASIC for SDL 2.0 to version 1.14y.  The differences in this version are:

  • Fixed a performance issue caused by yielding to the browser too often, which throttled graphics output.

  • Added the sortlib and eventlib libraries, compatible with those supplied with the other editions.

  • Added sorttest.bbc, in the examples/general/ directory, to test the sortlib library.

  • Added multitouch.bbc, in the examples/general/ directory, to demonstrate the eventlib library (needs a touchscreen).

  • Restored aliens.bbc to animate 80 sprites, to demonstrate the improved graphics performance (I get about 30 fps on my Core i7 laptop and 48 fps on my fastest desktop, both in Microsoft Edge).

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.

5
BBC BASIC / Re: New: In-browser BBC BASIC for SDL 2.0
« 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; 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.

6
BBC BASIC / New: In-browser BBC BASIC for SDL 2.0
« 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.

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.

7
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« on: August 04, 2020, 11:36:43 AM »
I have updated the Console Mode editions of BBC BASIC to version 0.25.  The main changes in this version are:

  • Fixed a bug which caused the expected 'Type mismatch' error not to be reported on assigning a string to a numeric variable!
  • Minor changes to the actions of the Esc key and on reporting an untrapped error, to improve consistency with other versions of BBC BASIC.
  • Added some libraries in the lib/ directory (arraylib, classlib, datelib, fnusing, sortlib, stringlib, utf8lib, xmllib).

Version 0.25 may be downloaded from the usual place:


8
BBC BASIC / BBC BASIC for SDL 2.0 version 1.14a released
« on: August 03, 2020, 10:01:17 PM »
I've released version 1.14a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  • BASIC Interpreter / Run Time Engine

    Added a *DUMP command to list the contents of a file in hexadecimal and ASCII.

    Suppressed issuing an ON MOVE interrupt if the window size is reported as zero.

    Tweaked the 64-bit and ARM editions to improve compatibility with the 32-bit x86 editions, for example Ctrl+U in immediate mode now works as expected.

    Fixed a line-editing issue which affected only the Raspberry Pi, because its 'char' datatype is unsigned.

  • IDEs and Utilities

    SDLIDE: The links to the website in the Help menu now specify https:// to suppress security warnings from modern browsers.

    BBCEdit: Updated to version 0.36.2 (with thanks to Andy Parkes).

  • Libraries

    Modified filedlg.bbc so that the file-system root has only one trailing / or \.

    Modified dlglib.bbc so input focus isn't acquired by an invisible control, and so textboxes are initially scrolled fully left.

  • Example Programs

    Updated SkyBaby.bbc to allow editing (but not deleting) a Custom Place or Custom Object.

    Updated telstar.bbc to support direct cursor addressing using the APS command.

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 and 64-bit Linux 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.

9
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« on: July 15, 2020, 08:30:14 AM »
I'm running Ubuntu 64 bit on my RPI 4B 4GB. Do you have a distribution for ARM 64 bit?

Sorry, no.  As you may know, 64-bit ARM compilers (e.g. GCC) are really peculiar in one respect: their 'long double' data type (which is what BBC BASIC uses as its default numeric type) doesn't correspond to any of the floating point types supported by the arm64's FPU but is a 128-bit extended-precision type implemented purely in software.  This breaks BBC BASIC in two ways: calculations are really slow, but more fundamentally I assume a 'long double' will fit in 10 bytes (as it does on an x86) rather than needing 16!

What's really annoying and (in my opinion) silly is that there's no GCC compiler switch to force 'long double' to be a synonym for 'double' as it is in all Microsoft's compilers.  That's what Apple's compiler does too, and is why a 64-bit ARM edition of BBC BASIC for iOS was possible whereas it currently isn't on other 64-bit ARM platforms.  Eventually I'll probably need to work around this issue by changing all my 'long double' type declarations to a user-defined type which can be #typedef'd to mean 'double' on ARM64, but I've not done that yet.

Quote
Curious why your 8queens example seems out of sequence. The last results are in the middle rather than the last row.

It's not 'my' example, you'd have to ask its author.  I assume he's displaying the first twelve solutions on the first page, then the next 12 on the next page (without clearing in between) and so on.  As there are 92 solutions in all, the final 8 are shown on the last page, below which the last four from the previous group of 12 can still be seen.

As the program has been used as a sort of benchmark I expect he did not want to scroll the display, or clear it between one group of 12 and the next, because that could skew the execution time depending on the speed of clearing/scrolling.

10
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« on: July 03, 2020, 04:46:06 PM »
I have updated the Console Mode editions of BBC BASIC to version 0.13.  The differences in this version are:

  • LISTIF is accepted (i.e. without a space, as other versions do).
  • RENUMBER now works even if only some lines are numbered.
  • New demo program 'chess.bbc' added (adapted from QBasic).
  • Demo program 'speed.bbc' modified to be more honest!

The updated version may be downloaded from the same place as before:


11
BBC BASIC / New: Console Mode editions of BBC BASIC
« on: June 28, 2020, 09:11:49 PM »
By popular request (well, three people!) I have created Console Mode editions of BBC BASIC for MacOS, Linux (64-bit), Windows (64-bit) and Raspbian (32-bit).  These have no graphics and no sound (nor do they support a mouse, joystick etc.) but their text-mode features are reasonably complete, so far as the capabilities of the native console/terminal allow (notably, text viewports are not supported).

You can think of them as BBC BASIC for SDL 2.0 with all the SDL stuff removed, and indeed that is effectively how they were created!  Their keyboard input is taken from stdin and their output is sent to stdout so you can use them for CGI applications or effectively as a replacement shell.  Normal shell commands can be issued by preceding them with a * in the usual BBC BASIC way.

These editions consist of compact self-contained executables with no dependencies on any third-party libraries; the BBC BASIC interpreter they contain is identical to that in BBC BASIC for SDL 2.0.  They should be considered as Beta test programs since they have not received extensive testing.  They are, of course, completely free and can be downloaded as follows:


Supplied with the executables are a small number of BBC BASIC demo programs. Here is the output from 8queens.bbc as seen in the Windows 10 console:

12
BBC BASIC / BBC BASIC for SDL 2.0 version 1.13a released
« on: June 19, 2020, 04:36:14 PM »
I've released version 1.13a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:
  • BASIC Interpreter / Run Time Engine

    Implemented VDU 23,18,3,n| to enable or disable alpha/graphics black and secondary character set in MODE 7.  It also 'fixes' the SAA5050 Hold Graphics bug.

    Implemented OSWORDs 139 & 140 (again!) to read and redefine the 'teletext' font (documented here).

    Reduced SOUND latency (which risks buffer underrruns on slow systems, but I hope is a better compromise).

    Setting bit 6 of *TEMPO changes the way the pitch envelope repeats to be more compatible with the BBC Micro (it's also now the default).

    Fixed a bug affecting 'scrolling' of one-row-high text viewports (64-bit and ARM editions only).

  • IDEs and Utilities

    SDLIDE: When loading an Acorn-format tokenised program, 2-byte tokens are automatically converted to their 1-byte equivalent (if any).

    SDLIDE: The file selector now uses smooth scrolling.

  • Libraries

    Added classlib for Object Oriented Programming, compatible with the BB4W library.

    Added mode7lib to support multiple character sets in MODE 7 (the primary and secondary character sets may be selected from English, German, Swedish, Belgian, Italian, Hebrew, Russian, Greek or US ASCII).

    Modified dlglib and filedlg to support smooth scrolling of listboxes.

  • Example Programs

    Added sortdemo.bbc (in examples/general) which is a graphical demonstration of six different sorting algorithms, adapted from a QuickBasic program.

    Added a page to mode7dem.bbc to demonstrate alpha/graphics black and the secondary character set.

    Tweaked bbclock.bbc to improve its reliability (previously it could misbehave after running for a few hours).

    Fixed telstar.bbc which was partially broken by the change of the MODE 7 font in v1.11a.

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 and 64-bit Linux 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.

13
BBC BASIC / BBC BASIC for SDL 2.0 version 1.12a released
« on: May 08, 2020, 05:18:29 PM »
I've released version 1.12a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:
  • BASIC Interpreter / Run Time Engine

    Updated the MacOS edition (only) to SDL 2.0.12 to fix some graphical glitches.

    Enabled render batching in the iOS edition (deferred from 1.11a because of a compatibility issue).

    Improved the Windows edition's compatibility with the username containing non-ASCII characters.

  • IDEs and Utilities

    In the SDLIDE file selector, starting to type the wanted filename scrolls the listbox.

    Updated BBCEdit to version 0.34.2 (thanks to Andy Parkes).

    Updated touchide to support copying-and-pasting entire directories.

    Fixed a memory leak in SDLIDE's Compile utility.

    When SDLIDE is used with BBC BASIC for Windows the Compile utility now works (it calls the BB4W compiler).

  • Libraries

    Added the imglib library for rotating, scaling and flipping 2D images efficiently (a highly compatible library is also available for BBC BASIC for Windows).

    Modified the filedlg library so that starting to type the wanted filename scrolls the listbox.

    Added FN_utf8_to_ansi() and FN_ansi_to_utf8() functions to the utf8lib library.

    Fixed a bug in the box2dgfx library affecting non-zero y-origin values when PROC_gfxMatrix is used.

  • Example Programs

    Added bbclock.bbc (in examples/physics), a graphical Box2D simulation of a 'Ball Bearing Clock'.  This program is compatible with BBC BASIC for Windows if the Box2D libraries are installed.

    Added dunebuggy.bbc (in examples/physics), a Box2D demo of a vehicle with sprung suspension.  This program is compatible with BBC BASIC for Windows if the Box2D libraries are installed.

    Added kerning.bbc (in examples/general/) to demonstrate the effect of kerning.  This program is compatible with BB4W.

    Modified aliens.bbc to use the new imglib library; this also makes it compatible with BB4W, but without hardware acceleration it runs only slowly.

    Fixed a bug in SkyBaby.bbc affecting some editions (e.g. Android but not Windows), caused by a surprising anomaly in the 'asctime' and 'mktime' C runtime library routines.
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 and 64-bit Linux editions, currently).

14
BBC BASIC / BBC BASIC for SDL 2.0 version 1.11a released
« on: March 28, 2020, 09:57:11 AM »
I've released version 1.11a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  • BASIC Interpreter / Run Time Engine

    Enabled render batching (in SDL 2.0.10 and later) which should improve graphics performance.

    Rationalised the VDU variables, e.g. ?444 and @vdu%!248 no longer have their previous functions.

    Added @vdu.w{a&,b&,c&,d&}, @size{x%,y%} and @char{x%,y%} to mirror some system variables.

    32-bit x86 editions now support the 64-bit indirection operator (]) as 64-bit and ARM editions always have.

    VDU 27,n (output symbol for character codes 0-31 and 127) now works in VDU 5 as well as VDU 4 mode.

    Changed the default MODE 7 font to be more similar to RISC OS and Matrix Brandy.

    Fixed a bug causing BBCSDL not to run properly if the installation path contained a 'dot' character.

  • IDEs and Utilities

    Updated BBCEdit to version 0.32.4, which fixes a minor bug in the last release.

    Enhanced SDLIDE so that the Tab key inserts eight spaces in the editor.

    Fixed a bug in the Compiler utility which could cause crunching to fail with code containing both 32-bit and 64-bit versions of a structure (e.g. box2dlib.bbc is in this category).

    Fixed a bug in the Search BASIC Programs utility which could cause it to freeze in rare circumstances.

  • Libraries

    The ogllib and gleslib 3D graphics libraries have been modified to improve support for point-source, spot- and directional lights (compatible, as far as I can reasonably achieve, with BB4W).

    The ellipse library has been updated to be compatible with 'render batching'.

    The dlglib library has minor improvements to the textbox and listbox.

    Svein has updated his treeview library to version 3.08, which has improved performance.

  • Example Programs

    Added spotlight.bbc in examples/graphics to demonstrate the different light types available in OpenGL.

    Added pintograph.bbc in examples/physics, a Box2D simulation of a drawing machine originally by Svein Svensson.  This program is compatible with BB4W if the Box2D libraries are installed.

    Added trebuchet.bbc in examples/physics, a Box2D simulation of a trebuchet by David Marples.  This program is compatible with BB4W if the Box2D libraries are installed.

    Modified getri.bbc to report whether render batching is enabled.

    Updated tower.bbc to ensure compatibility with render batching.
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 and 64-bit Linux 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.

15
BBC BASIC / BBC BASIC for SDL 2.0 version 1.10a released
« on: February 15, 2020, 02:35:45 PM »
I've released version 1.10a of BBC BASIC for SDL 2.0 - the cross-platform programming language for Windows, MacOS, Linux, Raspbian, Android and iOS.  The changes in this version are as follows:

  •   BASIC Interpreter / Run Time Engine

    Bundled the Box2D physics engine (as famously used by the Angry Birds games) with all editions.

    Fixed a bug causing ON GOTO statements to be incorrectly tokenised (64-bit and ARM editions only).

    Improved plotting accuracy of 'thick' diagonal lines, outline circles and outline ellipses.

    Updated the Android edition to SDL 2.0.10.  This has necessitated moving to a different build process (Android Studio) meaning you will need to uninstall then reinstall; see below.

  •   IDEs and Utilities

    Updated BBCEdit to version 0.32.3, many thanks to Andy Parkes for this new release.

    Fixed a minor problem in SDLIDE with pasting Unicode text containing the (a-grave) character.

    Fixed a bug in the Compiler utility which could cause creation of an app bundle to fail on MacOS if the installation path contains a space character.

    Modified the List Variables utility so that a mouse right-click clears the listbox selection.

  •   Libraries

    Added box2dlib.bbc and box2dgfx.bbc to support the Box2D physics engine.

    Fixed a bug in dlglib.bbc which affected the 'Save As' dialogue in SDLIDE, also improved operability by the Amazon Fire TV remote.

  •   Example Programs

    Added kaleidoscope.bbc in examples\graphics, adapted from David Williams's BB4W demo.

    Added three Box2D demonstration programs in examples\physics; these are also compatible with BBC BASIC for Windows if the Box2D libraries are installed:

     crates.bbc:  Falling boxes; on mobile devices tilting the screen has an interesting effect!
     dangle.bbc:  Touch the screen or use the mouse to grab the chain; also responds to tilting.
     lotto.bbc:   A simulation of a lottery selection machine.  Sorry, there's no prize if you win!

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 and 64-bit Linux editions, currently).

If you are using the iOS edition you should install this latest release to update the certificate, otherwise BBC BASIC will stop working when the current certificate expires on 23rd February.

If you are using the Android edition you will need to uninstall the previous version before installing this one.  Please check whether you have any personal files or folders stored in @usr$ and back them up (e.g. via a USB connection to a PC) so you can restore them after re-installation.

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.

Pages: [1] 2 3