Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

discuss PC<>Acorn file transfer issues & the use of FDC, XFER, Omniflop/disk etc.
Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Mon Jul 08, 2019 9:42 am

Actually (and admittedly counter-intuitively), you MUST NOT (unless you're running the latest git commit as of 11:11 UK time) put quotes around the file name even if there are spaces, as the entirety of the rest of the line is treated as the file name. If you provide quotes they will be treated as part of the file name!

(Though, yes, that is a bit daft - I've just added a commit to git that will strip quotes if the first and last characters of the filename are quote marks. They remain optional even if a space appears in the name.)

Code: Select all

OSCLI "ScreenSave "+filename$
will do exactly what you want. Just remember it will save a BMP file regardless of the extension provided.

Unlike RISC OS, MODE 7 screens can be saved, and any Teletext FLASH item is saved in the visible phase (not hidden).

Edited: pushed a git commit to deal with quote marks in the file name
Last edited by Soruk on Mon Jul 08, 2019 10:14 am, edited 4 times in total.

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by Soruk » Mon Jul 08, 2019 11:42 am

Hi,

I've just put together version 1.21.20. A number of updates and bug fixes have been wrapped up in this, including:
- Centisecond timer polling hived off to its own thread, as polling it every command iteration for ESCAPE checking was expensive.
- Program execution now much faster than before, and slightly faster again when ESCAPE is disabled via *FX200.
- Renamed some #DEFINEs as they were colliding on a new gcc on Cygwin.
- ESCAPE on VDU14 paged mode now works.
- INKEY no longer swallows a non-matching keypress.
- Some more OS SWIs implemented (the Snow demo from RISC OS Pico for RasPi now runs unmodified).
- Optionally allow an unselectable MODE to be substituted with another one instead of reporting "Screen moe is not available".
- Some more Raspberry Pi GPIO stuff, including recognising most RISC OS GPIO module SWI names, and implementing a few.
- Unsupported colour depths are mapped to 24-bit (previously was 8-bit), so a program asking for a 15-bit mode will be able to draw colours as largely intended.
- Extended OSBYTE 42 to allow an immediate refresh - SYS6,42,16 may be faster than parsing "*REFRESH" for anything time-critical (and obvious functionality that was missing from the interface)
- Quotes are stripped if appropriate from *ScreenSave and *ScreenLoad. They remain optional for filenames which include spaces.

Release is in all the usual places and in git.

scruss
Posts: 132
Joined: Sun Jul 01, 2018 3:12 pm
Location: Toronto
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.12 released

Post by scruss » Mon Jul 08, 2019 2:22 pm

Richard Russell wrote:
Mon Jul 08, 2019 8:12 am
OSCLI is the way to pass variables to 'star' commands::

Code: Select all

      OSCLI "ScreenSave " + bmpfile$
Indeed it is! Thank you. I now have all the screenshots I want, instead of just one last file called bmpfile$

Oh, and huge thanks to Soruk for maintaining and extending this. It's a stable, fast, cross-platform interpreter.
Last edited by scruss on Mon Jul 08, 2019 2:25 pm, edited 1 time in total.

User avatar
Richard Russell
Posts: 804
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Richard Russell » Mon Jul 08, 2019 3:02 pm

Soruk wrote:
Mon Jul 08, 2019 9:42 am
Actually (and admittedly counter-intuitively), you MUST NOT (unless you're running the latest git commit as of 11:11 UK time) put quotes around the file name even if there are spaces, as the entirety of the rest of the line is treated as the file name.
Presumably when the command takes (possibly optional) parameters after the filename quotes are required. Otherwise it's ambiguous as to whether what follows are parameters or part of the filename. That is the case for *SCREENSAVE in BB4W and BBCSDL (which can take the position and size of the graphics region to save) and for commands like *LOAD and *SAVE (which take the address and length of transferred memory). Or does Matrix Brandy by chance have no such commands?

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Mon Jul 08, 2019 4:29 pm

Richard Russell wrote:
Mon Jul 08, 2019 3:02 pm
Soruk wrote:
Mon Jul 08, 2019 9:42 am
Actually (and admittedly counter-intuitively), you MUST NOT (unless you're running the latest git commit as of 11:11 UK time) put quotes around the file name even if there are spaces, as the entirety of the rest of the line is treated as the file name.
Presumably when the command takes (possibly optional) parameters after the filename quotes are required. Otherwise it's ambiguous as to whether what follows are parameters or part of the filename. That is the case for *SCREENSAVE in BB4W and BBCSDL (which can take the position and size of the graphics region to save) and for commands like *LOAD and *SAVE (which take the address and length of transferred memory). Or does Matrix Brandy by chance have no such commands?
No such options, it's strictly *Screensave <filename> - SDL 1.2 just saves the entire surface area as a BMP - https://www.libsdl.org/release/SDL-1.2. ... vebmp.html
It might be possible in future to do that, by creating a new surface, copying the area to be saved then dumping that.

*LOAD and *SAVE are not supported, at this point in time.
Last edited by Soruk on Mon Jul 08, 2019 4:30 pm, edited 2 times in total.

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.12 released

Post by Soruk » Mon Jul 08, 2019 4:41 pm

scruss wrote:
Mon Jul 08, 2019 2:22 pm
Richard Russell wrote:
Mon Jul 08, 2019 8:12 am
OSCLI is the way to pass variables to 'star' commands::

Code: Select all

      OSCLI "ScreenSave " + bmpfile$
Indeed it is! Thank you. I now have all the screenshots I want, instead of just one last file called bmpfile$

Oh, and huge thanks to Soruk for maintaining and extending this. It's a stable, fast, cross-platform interpreter.
I'm glad you're enjoying using it. For me, it has been, and continues to be, a rather nice itch to scratch :D

User avatar
Richard Russell
Posts: 804
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Richard Russell » Mon Jul 08, 2019 4:46 pm

Soruk wrote:
Mon Jul 08, 2019 4:29 pm
*LOAD and *SAVE are not supported, at this point in time.
Well, OK, but surely the point remains valid. In principle there could be, and probably at some stage will be, 'star' commands that take a filename followed by parameters; this is a common pattern on most other BBC BASIC platforms. Similarly commands that take two filenames, like *COPY and *RENAME (or whatever the Brandy equivalents are); a similar ambiguity arises in that case if the first path/filename contains spaces. I would have expected that quotes would always be allowed, even when not essential, just as they are at the Linux and Windows command prompts.

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Mon Jul 08, 2019 11:47 pm

Richard Russell wrote:
Mon Jul 08, 2019 4:46 pm
Soruk wrote:
Mon Jul 08, 2019 4:29 pm
*LOAD and *SAVE are not supported, at this point in time.
Well, OK, but surely the point remains valid. In principle there could be, and probably at some stage will be, 'star' commands that take a filename followed by parameters; this is a common pattern on most other BBC BASIC platforms. Similarly commands that take two filenames, like *COPY and *RENAME (or whatever the Brandy equivalents are); a similar ambiguity arises in that case if the first path/filename contains spaces. I would have expected that quotes would always be allowed, even when not essential, just as they are at the Linux and Windows command prompts.
As of this morning's commit, quotes are allowed. The filename extraction is specific to *screensave and *screenload, which reminds me, I need to check *exec.

For any built-in *-commands that would require parameters after the filename (of which at the moment there are none) of course filename handling would need to be more exacting.

*Copy doesn't exist as such, under Windows it would, in Linux you'd use *cp as unrecognised *-commands are passed to the host OS shell.

User avatar
jgharston
Posts: 3566
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by jgharston » Mon Jul 08, 2019 11:53 pm

It's something I put in my notes to write a proper command parser. Last time I was working on the code (when I was in Japan last November!) the dispatcher was loads of if (strcmp(.... I rewrote the GSRead parser to get KEY and SHOW working properly because I was working on the keyboard handler which needed setting and reading soft keys working correctly.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Tue Jul 09, 2019 10:37 am

Soruk wrote:
Mon Jul 08, 2019 11:47 pm
As of this morning's commit, quotes are allowed. The filename extraction is specific to *screensave and *screenload, which reminds me, I need to check *exec.
Yep, *exec needed fixing too. Updated in git.

User avatar
Richard Russell
Posts: 804
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Richard Russell » Tue Jul 09, 2019 10:51 am

Soruk wrote:
Tue Jul 09, 2019 10:37 am
Yep, *exec needed fixing too. Updated in git.
*SPOOL, *SPOOLON ?

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Tue Jul 09, 2019 12:58 pm

Richard Russell wrote:
Tue Jul 09, 2019 10:51 am
Soruk wrote:
Tue Jul 09, 2019 10:37 am
Yep, *exec needed fixing too. Updated in git.
*SPOOL, *SPOOLON ?
Not (yet) implemented.*EXEC didn't exist in Matrix Brandy until a few months ago!

User avatar
Richard Russell
Posts: 804
Joined: Sun Feb 27, 2011 10:35 am
Location: Downham Market, Norfolk
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Richard Russell » Tue Jul 09, 2019 2:22 pm

Soruk wrote:
Tue Jul 09, 2019 12:58 pm
Not (yet) implemented.*EXEC didn't exist in Matrix Brandy until a few months ago!
Oh. I've always considered *SPOOL and *EXEC to be a related pair (it's not uncommon to *EXEC a file you previously created using *SPOOL) so I hadn't anticipated that one would be implemented without the other.

scruss
Posts: 132
Joined: Sun Jul 01, 2018 3:12 pm
Location: Toronto
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by scruss » Tue Jul 09, 2019 3:27 pm

Then again, with Brandy already loading text files rather than tokenized files via LOAD, *EXEC wouldn't really be a priority

User avatar
dhg2
Posts: 122
Joined: Tue Oct 25, 2016 7:37 pm
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by dhg2 » Tue Jul 09, 2019 6:22 pm

Maybe so, but don't forget that *EXEC is useful for stuff like pre-filling the INPUT buffer.
Regards,
- Patrick

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by Soruk » Tue Jul 09, 2019 7:51 pm

scruss wrote:
Tue Jul 09, 2019 3:27 pm
Then again, with Brandy already loading text files rather than tokenized files via LOAD, *EXEC wouldn't really be a priority
Brandy can load both tokenised (Acorn and BB4W/BBCSDL) files, but only saves as plain-text.

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.20 released

Post by Soruk » Wed Jul 10, 2019 5:19 am

Richard Russell wrote:
Tue Jul 09, 2019 2:22 pm
Soruk wrote:
Tue Jul 09, 2019 12:58 pm
Not (yet) implemented.*EXEC didn't exist in Matrix Brandy until a few months ago!
Oh. I've always considered *SPOOL and *EXEC to be a related pair (it's not uncommon to *EXEC a file you previously created using *SPOOL) so I hadn't anticipated that one would be implemented without the other.
Operative word above being "yet" - we now have them. I've also forced a rebuild of the nightly.

Soruk
Posts: 352
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Matrix Brandy BASIC V for Linux with SDL: V1.21.21 released

Post by Soruk » Tue Jul 16, 2019 4:53 pm

Bug fix posted: INT was accepting out-of-range values. It now reports an out-of-range error (as per BBC Micro and RISC OS).

Post Reply