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] 4 5
31
BBC BASIC / Re: New: Console Mode editions of BBC BASIC
« on: June 11, 2021, 02:57:53 PM »
I have updated the Console Mode editions of BBC BASIC to version 0.34.  The changes in this version are:

  • I've (hopefully) worked around the apparent bug in MinGW's implementation of the _ftelli64() function.
  • Execution speed has been improved by about 10% by optimising the expression evaluator.

Version 0.34 may be downloaded from the usual place:


32
BBC BASIC / BBC BASIC for SDL 2.0 version 1.22a released
« on: May 28, 2021, 04:56:15 PM »
I've released version 1.22a 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

    Cmd+left, Cmd+right, Cmd+up and Cmd+down are mapped to Home, End, Ctrl+Home and Ctrl+End, respectively, for improved compatibility with Apple Macs.

    In the in-browser edition *RUN now runs JavaScript code (previously it did nothing useful) e.g. OSCLI "window.open(""http://www.rtrussell.co.uk"")"

    The QUIT n statement can now accept a parameter of zero (ARM and 64-bit editions only, 32-bit x86 editions always could).

    A few performance optimisations have been carried out (e.g. fixing memory alignment issues).

  • IDEs and Utilities

    In SDLIDE.bbc Alt+left and Alt+right are mapped to Word Left and Word Right, respectively, for improved compatibility with Apple Macs.

    Added a -P command-line switch to SDLIDE.bbc to activate the profiler.

    The Android and iOS editions report if a later version is available.

  • Libraries

    Changed gleslib.bbc and ogllib.bbc to call glLightfv by address rather than name.

  • Example Programs

    Added Newton's Cradle simulation (cradle.bbc in examples/physics).

    Bundled the set of instructive Box2D demos in examples/physics/samples (these all use Debug Draw graphics).

    Updated sudoku.bbc to add Tidy and New Game options (the difficulty of the generated game is very variable!).

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

33
BBC BASIC / BBC BASIC for SDL 2.0 version 1.21a released
« on: April 16, 2021, 01:41:25 PM »
I've released version 1.21a 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

    Mapped keyboard shortcuts Cmd+A, Cmd+C, Cmd+F, Cmd+V, Cmd+X and Cmd+Z to their Ctrl equivalents for improved compatibility with Apple Macs.

    Fixed a couple of minor differences between the 32-bit x86 editions and the ARM/64-bit editions.

  • IDEs and Utilities

    Added compiler directives to SDLIDE.bbc to simplify building a standalone version in BB4W.

    Modified memusage.bbc, profiler.bbc, searchin.bbc and sdldebug.bbc to be compatible with BB4W as well as BBCSDL.

  • Libraries

    Added box2ddbg.bbc to support Box2D Debug Graphics, largely compatible with the equivalent BB4W library.

    Fixed a bug in box2dlib.bbc affecting Gear Joints on 64-bit platforms.

    Fixed a bug in dlglib.bbc causing the trackbar control not to scale to the specified range.

    Fixed a bug in treeview.bbc causing mouse clicks not to be reliably detected.

  • Example Programs

    Added pinball.bbc (in examples/physics) which demonstrates combining Box2D and 3D rendering.

    Added voronoi.bbc (in examples/graphics/) which is another shader demo.

    Modified recorder.bbc to increase the range of level adjustment (100% is now 'mid-range').

    Modified the other demos in examples/physics to take advantage of the box2ddbg library (press D to display the Debug Graphics).
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).

34
BBC BASIC / BBC BASIC for SDL 2.0 version 1.20a released
« on: March 04, 2021, 08:08:19 PM »
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:
  • 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).

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

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

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

35
BBC BASIC / BBC BASIC for SDL 2.0 version 1.18a released
« on: December 04, 2020, 12:28:38 PM »
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:

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

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

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

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

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

37
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:

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

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

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

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

42
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:


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

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

45
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:


Pages: 1 2 [3] 4 5