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

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

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

Post by Soruk » Sun Aug 12, 2018 9:30 am

Phlamethrower wrote:
Sun Aug 12, 2018 12:55 am
Don't forget that RISC OS has OS_Byte 112/113 for controlling screen banking. It's not quite the same functionality as *REFRESH, but if the intention is to keep Matrix Brandy programs compatible with RISC OS BASIC (and vice-versa) then supporting those calls would be useful.

Richard Russell's BASICs could theoretically support them as well, at least write-only via *FX.
I've committed a change which implements these - as SDL writes to a framebuffer, then only pastes it when SDL_Flip() or SDL_UpdateRect() is called, it tracks the values of 112 and 113, and if the same, refresh is turned on, otherwise turned off.

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

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

Post by Richard Russell » Sun Aug 12, 2018 9:47 am

Phlamethrower wrote:
Sun Aug 12, 2018 12:55 am
Richard Russell's BASICs could theoretically support them as well, at least write-only via *FX.
I expect so, In principle, but when using hardware-accelerated rendering (which is OpenGL in the case of BBCSDL) it's tricky to separate the texture onto which you are drawing and the texture which gets blitted to the screen. Not impossible, because you can create multiple textures which have the SDL_TEXTUREACCESS_TARGET property, but it would require a significant change in the internal architecture. *REFRESH comes effectively 'for free' because you can simply disable the blitting to the screen, and that works just as well in BB4W as in BBCSDL.

Bank switching sounds more sophisticated, and it may be that there are things it allows you to do that *REFRESH doesn't, but the latter is conceptually very simple and has proved sufficient for even the most challenging programs (e.g. David Williams' prizewinning video game Forces of Darkness).

Richard.

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

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

Post by Richard Russell » Sun Aug 12, 2018 9:50 am

Soruk wrote:
Sun Aug 12, 2018 9:30 am
I've committed a change which implements these - as SDL writes to a framebuffer, then only pastes it when SDL_Flip() or SDL_UpdateRect() is called, it tracks the values of 112 and 113, and if the same, refresh is turned on, otherwise turned off.
Just for clarity, have you actually implemented multiple frame buffers or are you simply using *FX112/113 as another way of enable or disabling refresh?

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

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

Post by Soruk » Sun Aug 12, 2018 9:57 am

Richard Russell wrote:
Sun Aug 12, 2018 9:16 am
jgharston wrote:
Sat Aug 11, 2018 11:50 pm
In the BBC environment, when the foreground application (eg BASIC) detects an Escape state it issues an EscapeAcknowledge OSBYTE &7E
On Escape, yes, but unless it also happens on all untrapped errors it doesn't resolve this issue. When developing a program, especially, an error such as 'Mistake' or 'No Such Variable' or 'Syntax Error', if it occurs during *REFRESH OFF (or other circumstances when the output is 'invisible'), will result in an (apparent) loss of control.

This is not so much of an issue when an IDE is in use (which will usually be the case with my BASICs, on desktop platforms at least) because the usual user action in that event is to close the 'output window'. It doesn't matter that the interpreter's output has been disabled, or is invisible, because the IDE is unaffected and the location of the error (also the error message in the case of BB4W) is likely to be shown there.

Richard.
Brandy doesn't use an IDE as such, it's closer to the traditional BASICs found in the BBC and RISC OS machines. And, with my OSBYTE 42 implementation, there's no reason to say it can't query the status upon an error condition, and if set appropriately, issue the refresh-on call, while maintaining language and OS separation.

User avatar
davidb
Posts: 2231
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

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

Post by davidb » Sun Aug 12, 2018 10:06 am

Phlamethrower wrote:
Sun Aug 12, 2018 12:55 am
Don't forget that RISC OS has OS_Byte 112/113 for controlling screen banking. It's not quite the same functionality as *REFRESH, but if the intention is to keep Matrix Brandy programs compatible with RISC OS BASIC (and vice-versa) then supporting those calls would be useful.

Richard Russell's BASICs could theoretically support them as well, at least write-only via *FX.
Doesn't ARM BASIC also have the WAIT keyword? I know it's not for bank switching itself, but it might be useful to support that for compatibility if it isn't already implemented.

Phlamethrower
Posts: 92
Joined: Fri Nov 24, 2017 1:35 pm
Contact:

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

Post by Phlamethrower » Sun Aug 12, 2018 10:26 am

davidb wrote:
Sun Aug 12, 2018 10:06 am
Phlamethrower wrote:
Sun Aug 12, 2018 12:55 am
Don't forget that RISC OS has OS_Byte 112/113 for controlling screen banking. It's not quite the same functionality as *REFRESH, but if the intention is to keep Matrix Brandy programs compatible with RISC OS BASIC (and vice-versa) then supporting those calls would be useful.

Richard Russell's BASICs could theoretically support them as well, at least write-only via *FX.
Doesn't ARM BASIC also have the WAIT keyword? I know it's not for bank switching itself, but it might be useful to support that for compatibility if it isn't already implemented.
Yes, it does.

(edit)

Which I should probably say is just a wrapper around the BBC-era OS Byte 19.
Last edited by Phlamethrower on Sun Aug 12, 2018 10:57 am, edited 1 time in total.

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

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

Post by Soruk » Sun Aug 12, 2018 11:40 am

Richard Russell wrote:
Sun Aug 12, 2018 9:50 am
Soruk wrote:
Sun Aug 12, 2018 9:30 am
I've committed a change which implements these - as SDL writes to a framebuffer, then only pastes it when SDL_Flip() or SDL_UpdateRect() is called, it tracks the values of 112 and 113, and if the same, refresh is turned on, otherwise turned off.
Just for clarity, have you actually implemented multiple frame buffers or are you simply using *FX112/113 as another way of enable or disabling refresh?
I haven't implemented multiple buffers (beyond what was needed to make Mode 7 flash work), but have exploited SDL1.2 only updating the display when SDL_Flip or SDL_UpdateRect are called, so until then you're effectively writing to one bank and displaying another.
However, I will look in to what is involved with actually setting up a second buffer (or multiple buffers).

Edit: This demo http://www.proggies.uk/riscosstuff/risc ... c/rpilogoT runs almost unmodified - only changing the SYS calls to BBC-style OSBYTE calls (and the ColourTrans call to GCOL r,g,b)
Last edited by Soruk on Sun Aug 12, 2018 2:04 pm, edited 1 time in total.

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

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

Post by jgharston » Sun Aug 12, 2018 2:36 pm

Richard Russell wrote:
Sun Aug 12, 2018 9:16 am
jgharston wrote:
Sat Aug 11, 2018 11:50 pm
In the BBC environment, when the foreground application (eg BASIC) detects an Escape state it issues an EscapeAcknowledge OSBYTE &7E
On Escape, yes, but unless it also happens on all untrapped errors it doesn't resolve this issue. When developing a program, especially, an error such as 'Mistake' or 'No Such Variable' or 'Syntax Error', if it occurs during *REFRESH OFF (or other circumstances when the output is 'invisible'), will result in an (apparent) loss of control.
Actually, on 6502 BASIC OSBYTE &7E is called by the error handler, so any error will cause an EscapeAcknowledge, and if an Escape is pending the Escape Effects (if enabled) will happen. This has caught me out a few times.

The code is essentially:
BIT ESCFLG:BPL next statement
BRK:EQUB 17:EQUS "Escape":BRK

ErrorHandler:
IF ERR=0 THEN ON ERROR OFF
LinePtr=ON ERROR program code
Do RESTORE, reset stack
(BASIC II and later also does OSBYTE &DA,0,0)
OSBYTE &7E
Jump to execute program code

So, a thought, implement OSBYTE 230 as b0-b3: things for OSBYTE &7E to do if an Escape state is pending, b4-b7: things for OSBYTE &7E to do regardless of Escape state.

Code: Select all

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

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Sun Aug 12, 2018 7:40 pm

How about doing an implied *REFRESH ON when returning to the command prompt when the program has finished executing? That should cover hitting the END token, simply getting to the end of the program, Escape, and an ON ERROR handler that finishes without transferring control back into the program.

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

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

Post by Richard Russell » Sun Aug 12, 2018 10:10 pm

Coeus wrote:
Sun Aug 12, 2018 7:40 pm
How about doing an implied *REFRESH ON when returning to the command prompt when the program has finished executing?
I guess it comes down to the trade-off between the usefulness of a modification and the potential for it to introduce an incompatibility with existing programs. It's conceivable that somebody might have used *REFRESH OFF specifically to stop the appearance of the prompt spoiling their graphics masterpiece, and they might not thank you for such a change!

Another factor, for me, is singling out *REFRESH for attention when there are several other ways in which control can (apparently) be lost, such as the foreground and background colours being the same, output having been disabled with VDU 21, the text viewport being ridiculously small, VDU 5 mode having been selected and the graphics cursor being outside the window etc.

As far as 'my' BASICs are concerned, it's unlikely that I will be making that change.

Richard.

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Sun Aug 12, 2018 11:18 pm

Richard Russell wrote:
Sun Aug 12, 2018 10:10 pm
Another factor, for me, is singling out *REFRESH for attention when there are several other ways in which control can (apparently) be lost, such as the foreground and background colours being the same, output having been disabled with VDU 21, the text viewport being ridiculously small, VDU 5 mode having been selected and the graphics cursor being outside the window etc.
I think what makes it different for me, compared to those other ways of changing things such that a prompt and anything typed at are not visible, is that this is a new addition since ARM BASIC whereas the other things you mention are not. The original aim of Brandy was implement BASIC as it existed on RiscOS so I was thinking what would be the least surprise there, but I note this is a feature copied from BBCB4W so it makes sense for it to be compatible between the two.

The other thing I had in mind is that with the original BBC micro one had two options to regain control of the machine. Escape would do a pretty good job for BASIC programs most of the time and in some other applications/languages too, but if that didn't result in a usable machine there was always the Break key and then, in BASIC, you could type OLD and continue editing your program (unless you'd set memory clear on break). If Brandy has the equivalent of the Break key then I have not found it.

Where I am going with this is that I think there should be a way to get a usable prompt at which you can continue to edit, or save, your program, without having to guess which mechanism is preventing you from seeing what is happening and typing blind to defeat it and certainly without having to re-start the interpreter from within its host OS.

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

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

Post by Richard Russell » Sun Aug 12, 2018 11:49 pm

Coeus wrote:
Sun Aug 12, 2018 11:18 pm
Where I am going with this is that I think there should be a way to get a usable prompt at which you can continue to edit, or save, your program
Fair enough. My BASICs don't even have a way of editing or saving the program from the prompt; the immediate mode commands were all stripped out when the BB4W IDE was created, more than 17 years ago! In the case of Brandy, which doesn't have an IDE, It's obviously much more important that control can be regained after a program exits, for whatever reason.

Once again I must apologise to Soruk for interjecting in his thread.

Richard.

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

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

Post by Soruk » Mon Aug 13, 2018 6:10 am

Richard Russell wrote:
Sun Aug 12, 2018 11:49 pm
Once again I must apologise to Soruk for interjecting in his thread.

Richard.
Not at all, it's always good to hear different points of view. Which is why I implemented REFRESH via an OSBYTE call, so the setting could be read and set via a defined interface, and added the onerror option so the OFF and ON options did exactly what they do in your version.

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

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

Post by Soruk » Mon Aug 13, 2018 8:03 am

Coeus wrote:
Sun Aug 12, 2018 11:18 pm
If Brandy has the equivalent of the Break key then I have not found it.
It doesn't. Also, while BREAK exists in RISC OS, most people have the "language" set to the Desktop, not BASIC. And, it's quite rare for "OLD" to do anything worthwhile in RISC OS, as the memory allocation is rather more fluid.

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

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

Post by Soruk » Mon Aug 13, 2018 11:45 am

Richard Russell wrote:
Sun Aug 12, 2018 9:50 am
Soruk wrote:
Sun Aug 12, 2018 9:30 am
I've committed a change which implements these - as SDL writes to a framebuffer, then only pastes it when SDL_Flip() or SDL_UpdateRect() is called, it tracks the values of 112 and 113, and if the same, refresh is turned on, otherwise turned off.
Just for clarity, have you actually implemented multiple frame buffers or are you simply using *FX112/113 as another way of enable or disabling refresh?
With some code checked in just now - I have actually implemented multiple frame buffers (4 out of the box). And that RasPi logo demo I linked earlier, also runs well with this. By a separate check and not overwriting the value of *Refresh to maintain the performance boost of not updating, I don't do a display update if displaybank != writebank.

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

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

Post by dhg2 » Mon Aug 13, 2018 5:34 pm

I'm noticing that the latest version of brandy from github seems to be slower than the previous version that I was using (downloaded from github about two days ago). I wonder if it's related to the changes for supporting multiple frame buffers.
I tested it with this program: http://dusthillguy.ddns.net/folder/file ... awtest.txt

With the previous version of brandy, I get about 170 frames, and with the newer version I get about 90.
Regards,
- Patrick

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

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

Post by Soruk » Mon Aug 13, 2018 5:39 pm

dhg2 wrote:
Mon Aug 13, 2018 5:34 pm
I'm noticing that the latest version of brandy from github seems to be slower than the previous version that I was using (downloaded from github about two days ago). I wonder if it's related to the changes for supporting multiple frame buffers.
I tested it with this program: http://dusthillguy.ddns.net/folder/file ... awtest.txt

With the previous version of brandy, I get about 170 frames, and with the newer version I get about 90.
I'll look into it, though I'd have thought it would be more likely to be the Escape key polling.
Edit: looking at the code, it might be faster to use *FX112,2 to draw to the second bank then *FX113,2 to display it afterwards, than just disable refresh.
However, I may be able to make both options equally fast.
Last edited by Soruk on Mon Aug 13, 2018 6:07 pm, edited 1 time in total.

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Mon Aug 13, 2018 6:11 pm

Timings for recent versions, working backwards in time:

Code: Select all

27b25239d8f7968576274a27235501e4a76559db 221
f0f964a8e7b4bdc1308baa4ddc661e767f58acdb 208
9cbd64902df234e212f5772b6f34c5f43677487b 287
b2dc4c9c04bd39454f49f831845dc0171e41971f 364
99f713554715f31d5a0f349f4e6ea1520a8b7306 388
125d0283d7ac5df8572da062aed155355dab581a 362 (1.21.9)
Last edited by Coeus on Mon Aug 13, 2018 6:11 pm, edited 1 time in total.

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

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

Post by Soruk » Mon Aug 13, 2018 10:08 pm

dhg2 wrote:
Mon Aug 13, 2018 5:34 pm
I'm noticing that the latest version of brandy from github seems to be slower than the previous version that I was using (downloaded from github about two days ago). I wonder if it's related to the changes for supporting multiple frame buffers.
I tested it with this program: http://dusthillguy.ddns.net/folder/file ... awtest.txt

With the previous version of brandy, I get about 170 frames, and with the newer version I get about 90.
I've done some optimisations on the code - and added the facility to tune the polling interval to check for ESCAPE. It certainly runs faster for me (up from 85 to 125 on my CentOS 6 VM).

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Mon Aug 13, 2018 11:03 pm

Soruk wrote:
Mon Aug 13, 2018 10:08 pm
I've done some optimisations on the code - and added the facility to tune the polling interval to check for ESCAPE. It certainly runs faster for me (up from 85 to 125 on my CentOS 6 VM).
That's certainly faster for me - around 300 (tried a few times). I am not having much luck with varying the Escape polling and getting any difference above noise. Maybe I am not using it properly.

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

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

Post by Soruk » Mon Aug 13, 2018 11:08 pm

Coeus wrote:
Mon Aug 13, 2018 11:03 pm
Soruk wrote:
Mon Aug 13, 2018 10:08 pm
I've done some optimisations on the code - and added the facility to tune the polling interval to check for ESCAPE. It certainly runs faster for me (up from 85 to 125 on my CentOS 6 VM).
That's certainly faster for me - around 300 (tried a few times). I am not having much luck with varying the Escape polling and getting any difference above noise. Maybe I am not using it properly.
Try comparing *FX42,2,0 and *FX42,3,0 (Poll once every one BASIC instruction) with *FX42,2,255 and *FX42,3,255 (Poll once every 65,536 BASIC instructions).

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Mon Aug 13, 2018 11:13 pm

Soruk wrote:
Mon Aug 13, 2018 11:08 pm
Try comparing *FX42,2,0 and *FX42,3,0 (Poll once every one BASIC instruction) with *FX42,2,255 and *FX42,3,255 (Poll once every 65,536 BASIC instructions).
With both zero I get about 275. Interestingly I got 312 with both set to 127 and 313 with both set to 255.

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

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

Post by Soruk » Mon Aug 13, 2018 11:20 pm

Coeus wrote:
Mon Aug 13, 2018 11:13 pm
Soruk wrote:
Mon Aug 13, 2018 11:08 pm
Try comparing *FX42,2,0 and *FX42,3,0 (Poll once every one BASIC instruction) with *FX42,2,255 and *FX42,3,255 (Poll once every 65,536 BASIC instructions).
With both zero I get about 275. Interestingly I got 312 with both set to 127 and 313 with both set to 255.
I'd expect that. With both set to 127, it'll be polling once every 16,384 instructions. As the numbers increase the returns diminish.

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

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

Post by jgharston » Mon Aug 13, 2018 11:23 pm

Soruk wrote:
Mon Aug 13, 2018 11:08 pm
Coeus wrote:
Mon Aug 13, 2018 11:03 pm
Soruk wrote:
Mon Aug 13, 2018 10:08 pm
I've done some optimisations on the code - and added the facility to tune the polling interval to check for ESCAPE. It certainly runs faster for me (up from 85 to 125 on my CentOS 6 VM).
That's certainly faster for me - around 300 (tried a few times). I am not having much luck with varying the Escape polling and getting any difference above noise. Maybe I am not using it properly.
Try comparing *FX42,2,0 and *FX42,3,0 (Poll once every one BASIC instruction) with *FX42,2,255 and *FX42,3,255 (Poll once every 65,536 BASIC instructions).
Argh!!!! No no no no no no no! OSBYTEs <&80 take and return only ONE parameter. Don't break the API!

Code: Select all

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

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

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

Post by Soruk » Mon Aug 13, 2018 11:46 pm

jgharston wrote:
Mon Aug 13, 2018 11:23 pm
Soruk wrote:
Mon Aug 13, 2018 11:08 pm
Coeus wrote:
Mon Aug 13, 2018 11:03 pm
That's certainly faster for me - around 300 (tried a few times). I am not having much luck with varying the Escape polling and getting any difference above noise. Maybe I am not using it properly.
Try comparing *FX42,2,0 and *FX42,3,0 (Poll once every one BASIC instruction) with *FX42,2,255 and *FX42,3,255 (Poll once every 65,536 BASIC instructions).
Argh!!!! No no no no no no no! OSBYTEs <&80 take and return only ONE parameter. Don't break the API!
I was unable to find an unused one >=128, so picked a spare one. And, this one is local to Brandy and wanted to keep everything under one number rather than spreading out. But, the code behind it is happy, and return values where appropriate are in the right format. Restricting the use of Y to OSBYTEs >=128 is rather wasteful. Perhaps it's a side-effect of cramming them all in the BBC ROM.

User avatar
sweh
Posts: 1969
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

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

Post by sweh » Tue Aug 14, 2018 2:07 am

jgharston wrote:
Mon Aug 13, 2018 11:23 pm
Argh!!!! No no no no no no no! OSBYTEs <&80 take and return only ONE parameter. Don't break the API!
Not strictly true, according to the AUG:

OSBYTE &01 (1) *FX 1

Read/write the user flag

Entry parameters: The user flag is replaced by
(<old value> AND Y) EOR X

i.e. Y=0 for write, Y=&FF for read

On exit,
X=old value

This call uses OSBYTE call with A=&F1 (241). This OSBYTE call is left free for user applications and is not used by the operating system. The user flag is stored in location &281 and its default value is 0.
Rgds
Stephen

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

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

Post by Soruk » Tue Aug 14, 2018 6:22 am

jgharston wrote:
Mon Aug 13, 2018 11:23 pm
Argh!!!! No no no no no no no! OSBYTEs <&80 take and return only ONE parameter. Don't break the API!
While I'm not particularly worried about using the full range of the OSBYTE call on an unallocated value, perhaps overlaying *FX163 might be better? According to your docs on BeebWiki, only X=128,242,243 and 255 are allocated, so might be a better fit than using the unallocated *FX42? Unfortunately there's no unallocated value where A >= 128.

...or, I'll just split it out to a handful of codes around the 40s.
Last edited by Soruk on Tue Aug 14, 2018 8:48 am, edited 3 times in total.

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

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

Post by Richard Russell » Tue Aug 14, 2018 11:40 am

Coeus wrote:
Mon Aug 13, 2018 11:03 pm
That's certainly faster for me - around 300 (tried a few times).
For the purposes of comparison, BBC BASIC for Windows reports 8 (yes, just eight frames in 1.5 seconds!) when running that program, minimally modified to achieve compatibility. So on the basis of that benchmark (which may or may not be typical) Brandy is approximately 37 times faster than BB4W. :lol:

Richard.

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

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

Post by Soruk » Tue Aug 14, 2018 11:53 am

Richard Russell wrote:
Tue Aug 14, 2018 11:40 am
Coeus wrote:
Mon Aug 13, 2018 11:03 pm
That's certainly faster for me - around 300 (tried a few times).
For the purposes of comparison, BBC BASIC for Windows reports 8 (yes, just eight frames in 1.5 seconds!) when running that program, minimally modified to achieve compatibility. So on the basis of that benchmark (which may or may not be typical) Brandy is approximately 37 times faster than BB4W. :lol:

Richard.
What were you running that on - a Geode? :lol:

Coeus
Posts: 1079
Joined: Mon Jul 25, 2016 11:05 am
Contact:

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

Post by Coeus » Tue Aug 14, 2018 12:25 pm

Soruk wrote:
Tue Aug 14, 2018 11:53 am
What were you running that on - a Geode? :lol:
I had never heard of one of those so I had to look it up. As I was searching I was thinking "Diode, Triode, Pentode, Geode" and expecting some valve based thing from the 1950s but it seems it is much more mundane and is what has turned into the AMD version of the Atom.

Post Reply