Date   
Re: BBC BASIC for SDL 2.0 v0.20a on macOS

Richard Russell
 

On Sun, Feb 11, 2018 at 09:25 am, Rob McKay wrote:
it uses the Ctrl key, rather than the Cmd key for keyboard shortcuts like copy and paste.
All the editions of BBCSDL - Windows, Linux, Mac OS, Android, Raspberry Pi - share the same code and it's the responsibility of the SDL 2.0 'abstraction layer' to determine how it maps to the specific features of each platform.  If the usual convention is for the Ctrl key in Windows and Linux to map to the Cmd key in Mac OS then SDL would need to do it, but evidently it doesn't.  If you feel really strongly about it I suggest you raise the issue at the SDL forum.

The second is that keyword shortcuts such as P. for PRINT don't  seem to work.
They don't work in BBC BASIC for Windows either, in the (common) situation in which the 'Accept Keyword Abbreviations' option is disabled.  The main reason is that keyword abbreviations conflict with the structure syntax.  For example suppose one defines a structure P thus:

      DIM P{member1, member2}

Then to initialise the members of the structure one would do something like:

      P.member1 = one
      P.member2 = two

But of course if keyword abbreviations were enabled those would expand to:

      PRINTmember1 = one
      PRINTmember2 = two

which makes no sense.  But, as I always say, one reason why the BBCSDL IDEs are written in BASIC is to allow individual users to tailor them to their own requirements.  If you feel that accepting keyword abbreviations is more important than compatibility with structure syntax feel free to modify the code yourself.

Richard.

Testers wanted

Richard Russell
 

I am developing a software tool which will automatically convert a BBC BASIC program to an Android app. My objective is to make it as straightforward to create an APK file for Android as it is to create an EXE file for Windows using BB4W! Enough of it is working to give me confidence that I will succeed: here is an APK for David Williams' Forces of Darkness game that I made this way (40 Mbytes):

http://www.rtr.myzen.co.uk/FOD.apk

Because the user-interface is such an important aspect of the program I would like to invite people to try it out and give me their feedback before it is formally released. The prerequisites are that you must have written a BBC BASIC program which you have confirmed works on an Android device (using BBCSDL), and that you have a relatively modern Windows PC which has Java 1.7 or later installed (or on which you are happy to install Java).

If you would like to volunteer let me know.

Richard.

Re: Testers wanted

Storer, Darren
 

Hi Richard,

This is exciting news!

Yes, I would like to test the Androip app converter and I confirm that I have all the prerequisites.

Many thanks

Darren

On 12 February 2018 at 00:44, Richard Russell <news@...> wrote:
I am developing a software tool which will automatically convert a BBC BASIC program to an Android app. My objective is to make it as straightforward to create an APK file for Android as it is to create an EXE file for Windows using BB4W! Enough of it is working to give me confidence that I will succeed: here is an APK for David Williams' Forces of Darkness game that I made this way (40 Mbytes):

http://www.rtr.myzen.co.uk/FOD.apk

Because the user-interface is such an important aspect of the program I would like to invite people to try it out and give me their feedback before it is formally released. The prerequisites are that you must have written a BBC BASIC program which you have confirmed works on an Android device (using BBCSDL), and that you have a relatively modern Windows PC which has Java 1.7 or later installed (or on which you are happy to install Java).

If you would like to volunteer let me know.

Richard.


Re: Testers wanted

Paul Marshall
 

On Sun, Feb 11, 2018 at 04:44 pm, Richard Russell wrote:
you must have written a BBC BASIC program which you have confirmed works on an Android device (using BBCSDL),

I have only one such program (apart from Dibley) but I would be pleased to volunteer as a tester.  I'm on Java 1.8.

There is another program on the way, it works in SDL but I have to convert some right mouse clicks into some other gesture.
Paul.

Re: Testers wanted

Richard Russell
 

On Mon, Feb 12, 2018 at 01:43 am, Paul Marshall wrote:
I have to convert some right mouse clicks into some other gesture.
Most commonly this is 'long press' (press and hold).

The BBC2APK tool isn't ready yet but I'll be in touch when it is.

Richard.

Re: Testers wanted

J.G.Harston
 

Richard Russell wrote:
If you would like to volunteer let me know.
I've just done a refresh of my BB4W and BBCSDL on my laptop and my Android thingy to test coding on it. The programs I've been testing work so far in the main, but there are a few issues mainly with the environment they are running in.

A few of some of them expect command line parameters (eg AsmPDP). I've been trying to write a sort-of shell so these programs can be given parameters to run with.

Most expect that *Quit takes you back to somewhere where you can run another program, or to a caller.

It's frustrating that *Quit takes me back to the Android main screen and I have to re-run Basic, I've just accidently done it again just now when testing. It then means having to restart Basic and trekking all the way through the filesystem to find my files again.

My file picker defines a key to re-CHAIN itself in a similar way that the ones supplied do, but it's so easy to forget to press it and stop your muscle memory typing *Quit, and that's no help for programs that are coded to exit with *Quit. It's not a very satisfactory solution to rewrite everything to include something like:

IF on this one envirotnment THEN do something complicated ELSE *Quit

It would be more useful if *Quit could be definable to do something specific to the platform so it could configured to do, eg, 'sdlbbc path\to\myfilepicker.bbc'. Then I would be back to an environment where I could continue navigating and selecting/editing/running programs. Comparable to working on a desktop where you effectively get back to a filer window where you can continue navigating, or even old-style returning to a command prompt and continue *DIR, *CAT, LOAD, RUN, etc.


Another annoyance is that *Quit takes me back to some unknown part of the filesystem that I have to navigate out of to find my files, though this is probably an Android issue. I have to go to @usr\..\..\..\..\ to find the visible part of the filesystem.

I transfered a bunch of code onto my tablet by plugging it into my PC as a storage device and copying things to \Downloads\Basic. However, when Basic starts I have to navigate out of where it starts to find \Downloads\Basic, and when I forget and use *Quit to exit a program I have to go all the way through again. I tried to copy my files into where Basic starts up, intending to add a 'mycode' directory to 'examples', but it I can't find its location. It seems to be "above" the root directory that is visible when transfering data over. I can navigate to it on the tablet with the various BBC BASIC file pickers, but can't navigate to it from an environment where I can copy and move files around.

--
J.G.Harston - jgh@... - mdfs.net/jgh

Bedstead font

J.G.Harston
 

I was playing around with Bedstead font in some documentation I was editing yesterday, and remembered a post that it now came with BB4W. (Bedstead is the SAA505x MODE 7 font)

A quick test and it looks just perfect. However, using it drops characters. The following test program shows this:

MODE 7
*Font Bedstead,15
PRINT ''''''
FOR A=32 TO 126:VDU A:NEXT A:PRINT
FOR A=0 TO 24:PRINT TAB(A,A);CHR$(129+(A MOD 7));"line ";A;CHR$135;:NEXT A

Thirteen characters disappear off the right side of the screen, giving:

!"#$%& line 7 /0123456789:;<=>?@ABCDEFG
UVWXYZ<\ line 8 efghijklmnopqrstuvwxyz\|
line 9

instead of:

!"#$%& line 7 /0123456789:;<=>?@ABCDEFG
HIJKLMNO line 8 XYZ<\>^_£abcdefghijklmno
pqrstuvwx line 9

I updated BB4W this morning to do these tests, so running on BB4W 6.11a (also tested on a test copy of 5.95).

SDL BASIC 0.20 for Windows gives No such font.

--
J.G.Harston - jgh@... - mdfs.net/jgh

Re: Bedstead font

Richard Russell
 

On Mon, Feb 12, 2018 at 06:27 am, J.G.Harston wrote:
Thirteen characters disappear off the right side of the screen,
Traditional teletext displays (i.e. on TV sets) have an aspect ratio much closer to 1:1 than the 4:3 aspect ratio of MODE 7, therefore the characters in the Bedstead font are also narrower: 12 pixels rather than the 16 pixels expected by MODE 7.  That means that about 53 characters rather than the usual 40 'fit' across the width of the screen; you can see this directly if you select MODE 6 rather than MODE 7.

In MODE 7 the character positioning is not determined by the character width (it is fixed at 40 characters per line) but the automatic end-of-line wrapping still is, which is why 13 characters are 'missing'.  One solution is to use the 'Bedstead-ext' font, which has the wanted 16-pixel width; had you checked the fonts supplied with BBCSDL you would have found that 'Bedstead-ext.otf' is included but 'Bedstead.otf' isn't.

Another solution is to force the character width to 16 pixels, overriding the value in the font file itself.  Generally you have to force the height anyway, in BB4W, because of the DPI issue (the font size is set in 'points' and the relationship between 'points' and 'pixels' depends on the DPI).  This code does both:

      MODE 7
      @vdu%!220 = -20 : REM Force character height to 20 pixels
      *FONT Bedstead
      @vdu%!216 = 16  : REM Force character width to 16 pixels

      PRINT ''''''

      FOR A=32 TO 126:VDU A:NEXT A:PRINT
      FOR A=0 TO 24:PRINT TAB(A,A);CHR$(129+(A MOD 7));"line ";A;CHR$135;:NEXT A

Richard.

Re: Testers wanted

Richard Russell
 

On Mon, Feb 12, 2018 at 06:26 am, J.G.Harston wrote:
Most expect that *Quit takes you back to somewhere where you can run another program, or to a caller.
I never use *QUIT (in fact I'd forgotten that the command even existed) because it's synonymous with the QUIT statement in BASIC.  In the official RISC OS manual for BBC BASIC the action of the QUIT statement is specified as "leaves the BASIC interpreter" which is exactly what it does in both BB4W and BBCSDL.

If the interpreter has been invoked from an IDE then it's reasonable that QUIT should return to the IDE, which again is exactly what it does in BB4W and the desktop editions of BBCSDL.  If it's been invoked from a command prompt, QUIT returns to the command prompt.  But when BBC BASIC has been invoked from the desktop QUIT returns to the desktop, and since it's the only way it can be invoked in Android that's what happens!

> It would be more useful if *Quit could be definable to do something specific to the platform

I don't see how it could ever do anything "different" from exiting the interpreter; you can't even assume that the interpreter is in a 'fit state' to do anything else (the QUIT might have been issued from a 'fatal error' handler). The responsibility for what happens after the QUIT properly belongs to the program that invoked the interpreter in the first place. In an ideal world the Android edition of BBC BASIC would work the same way as the desktop editions, in which the IDE runs as a separate process, but I've no idea how to do that or indeed whether it is even possible.

Quit takes me back to some unknown part of the filesystem

It doesn't take you "back" anywhere because Android doesn't have the concept of 'current directory'. That's why all paths need to be absolute (i.e. typically prefixed with @dir$, @lib$ etc.) in an Android-compatible BBC BASIC program.

Richard.

Re: Testers wanted

 

I would very much like to do this kind of thing. I don’t yet have the Android device I’ll be using (the Gemini PDA, on its way to me from China) but once I do and I have figured out how to use Android, I have any number of things I’d like to make into Android apps. So I’ll watch this space.

Wikispaces is closing down

Richard Russell
 

Wikispaces (who host the BB4W and LBB wiki) are closing down later in the year; here is the official announcement.

The two big advantages of Wikispaces over most other wiki hosting sites are the freedom from advertisements (and therefore the uncluttered nature of the pages) and the syntax colouring; it is the only wiki I know that supports syntax colouring for BBC BASIC.

We have discussed our options before, when Wikispaces introduced an annual subscription, but the very fact that people have been prepared to pay shows that no entirely satisfactory alternative has been identified.

Richard.

Re: Wikispaces is closing down

Alex Farlie
 

So you are aware i have no objection to my content contributions to this site being archived in appropriate form.

Re: Wikispaces is closing down

Storer, Darren
 

Hi Richard,

Would it be possible to provide an archive of the BB4W Wiki before it closes? Some time ago I seem to remember a thread about requesting access to an archive but I'm happy to make my own if there is a simple procedure.

Many thanks

Darren
 

On 12 February 2018 at 16:47, Richard Russell <news@...> wrote:
Wikispaces (who host the BB4W and LBB wiki) are closing down later in the year; here is the official announcement.

The two big advantages of Wikispaces over most other wiki hosting sites are the freedom from advertisements (and therefore the uncluttered nature of the pages) and the syntax colouring; it is the only wiki I know that supports syntax colouring for BBC BASIC.

We have discussed our options before, when Wikispaces introduced an annual subscription, but the very fact that people have been prepared to pay shows that no entirely satisfactory alternative has been identified.

Richard.


Re: Wikispaces is closing down

Richard Russell
 

On Mon, Feb 12, 2018 at 10:16 am, Storer, Darren wrote:
I seem to remember a thread about requesting access to an archive but I'm happy to make my own if there is a simple procedure.
I think we established fairly recently that Wikispaces at some point 'changed the rules' and only an organiser (which means me or Jonathan) can initiate an export.  But before doing that we need to know in which format it will be most useful (there are nine different formats on offer!) and that in turn depends on where we propose to move it, if anywhere.  Previous attempts at making a decision have not got very far, but of course then we had the option of sticking with Wikispaces - at a cost.  Now we don't.

Richard.

Re: Testers wanted

Richard Russell
 

On Mon, Feb 12, 2018 at 01:43 am, Paul Marshall wrote:
I have only one such program (apart from Dibley) 
Here's an APK of Dibley made using the new tool in its incomplete state:

  https://www.dropbox.com/s/muu8sr9ffurjweg/dibley.apk?dl=0

It was actually a valuable test because it showed that the Java tool I am using can't cope with files or directories starting with a 'dot' (which the resources directories .Demo, .Graphics and .Levels do in their BBCSDL forms).  I had to get rid of the dots to allow the APK to build; no great hassle but certainly something to be aware of.

Richard.

Re: Wikispaces is closing down

Andrew Cool
 

Can we hedge our bets by exporting all 9 different formats?

 

Andrew


Virus-free. www.avg.com

Re: Wikispaces is closing down

Storer, Darren
 

Hi Richard,

Thanks for the clarification about export formats. A quick Google search didn't bring up the list of export types but I did spot that static HTML was available; from a selfish viewpoint, this would serve my needs. 

Please could I have a static HTML export of the BB4W wiki? Whilst static an HTML version wouldn't be trivially extensible, it will be very easy to browse and on occasion I could manually update pages locally.

On the other hand, the option of PDF format was not attractive at all...

Many thanks

Darren

On 12 February 2018 at 22:10, Richard Russell <news@...> wrote:
On Mon, Feb 12, 2018 at 10:16 am, Storer, Darren wrote:
I seem to remember a thread about requesting access to an archive but I'm happy to make my own if there is a simple procedure.
I think we established fairly recently that Wikispaces at some point 'changed the rules' and only an organiser (which means me or Jonathan) can initiate an export.  But before doing that we need to know in which format it will be most useful (there are nine different formats on offer!) and that in turn depends on where we propose to move it, if anywhere.  Previous attempts at making a decision have not got very far, but of course then we had the option of sticking with Wikispaces - at a cost.  Now we don't.

Richard.


Re: Bedstead font

Storer, Darren
 

Apologies for hijacking another thread but the references to MODE 7 reminded me that I've been trying in vain to run MODE 7 routines (mostly PC platform but later to run on Android) in full screen. 

There are a couple of techniques to run in full screen (with and without border) which both work but I'm struggling to scale the MODE 7 text to fill the screen... Any hints gratefully received.

Many thanks

Darren
PS. JGH: If the USB keyboard I lent you in Manchester is of any use, please keep it, otherwise I'll collect it at the next event we both attend - sorry I couldn't return on the Sunday. 

On 12 February 2018 at 15:24, Richard Russell <news@...> wrote:
On Mon, Feb 12, 2018 at 06:27 am, J.G.Harston wrote:
Thirteen characters disappear off the right side of the screen,
Traditional teletext displays (i.e. on TV sets) have an aspect ratio much closer to 1:1 than the 4:3 aspect ratio of MODE 7, therefore the characters in the Bedstead font are also narrower: 12 pixels rather than the 16 pixels expected by MODE 7.  That means that about 53 characters rather than the usual 40 'fit' across the width of the screen; you can see this directly if you select MODE 6 rather than MODE 7.

In MODE 7 the character positioning is not determined by the character width (it is fixed at 40 characters per line) but the automatic end-of-line wrapping still is, which is why 13 characters are 'missing'.  One solution is to use the 'Bedstead-ext' font, which has the wanted 16-pixel width; had you checked the fonts supplied with BBCSDL you would have found that 'Bedstead-ext.otf' is included but 'Bedstead.otf' isn't.

Another solution is to force the character width to 16 pixels, overriding the value in the font file itself.  Generally you have to force the height anyway, in BB4W, because of the DPI issue (the font size is set in 'points' and the relationship between 'points' and 'pixels' depends on the DPI).  This code does both:

      MODE 7
      @vdu%!220 = -20 : REM Force character height to 20 pixels
      *FONT Bedstead
      @vdu%!216 = 16  : REM Force character width to 16 pixels

      PRINT ''''''

      FOR A=32 TO 126:VDU A:NEXT A:PRINT
      FOR A=0 TO 24:PRINT TAB(A,A);CHR$(129+(A MOD 7));"line ";A;CHR$135;:NEXT A

Richard.


Re: Testers wanted

Paul Marshall
 

On Mon, Feb 12, 2018 at 01:45 am, Richard Russell wrote:
Most commonly this is 'long press' (press and hold).
This is a bit more challenging but that is all part of the fun - I have some controls which are decremented by a left-click and incremented by a right-click so I intend to make it work by dragging up & down. Other than that it was all quite straightforward!

Re: Testers wanted

Paul Marshall
 

Brilliant!  Confirmed it downloads, installs and opens on my Android tablet in seconds with minimal effort. The icon looks good too.
This is a major step forward, thanks Richard.

>  I had to get rid of the dots
I never did understand why they were there.