Raspberry BASIC

Recent Posts

Pages: [1] 2 3 ... 10
1
BBC BASIC / BBC BASIC for SDL 2.0 version 1.17a released
« Last post by Richard Russell 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
« Last post by Richard Russell 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 / Re: BBC BASIC for SDL 2.0 version 1.15a released
« Last post by John Spikowski on September 11, 2020, 08:44:11 PM »
Thanks Richard for the update and keeping this forum active with content.
4
BBC BASIC / BBC BASIC for SDL 2.0 version 1.15a released
« Last post by Richard Russell 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).
5
BBC BASIC / Re: New: In-browser BBC BASIC for SDL 2.0
« Last 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 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.
6
BBC BASIC / Re: New: In-browser BBC BASIC for SDL 2.0
« Last 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; 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.
7
BBC BASIC / New: In-browser BBC BASIC for SDL 2.0
« Last 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.

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.
8
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« Last post by Richard Russell 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:

9
BBC BASIC / BBC BASIC for SDL 2.0 version 1.14a released
« Last post by Richard Russell 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.
10
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« Last post by Richard Russell 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.
Pages: [1] 2 3 ... 10