SDL problems

Discussions related specifically to the Windows, Linux (86), Mac OS-X and Raspberry Pi editions of BB4W and BBCSDL
KenDown
Posts: 261
Joined: Wed 04 Apr 2018, 06:36

SDL problems

Post by KenDown »

I've been playing around with SDL a bit and am having some problems. If anyone has any advice?

The first is a problem that others have mentioned before me: double-click on bbcsdl.exe and every so often it simply fails to start - you just get a window with a copyright message and the > prompt. I've tried tying "RUN" but it does nothing.

It may seem an odd thing to do, but I have a BASIC program in an .epub file. If I copy it and then try to paste it in SDL, you get some very odd results.

x%=100
      y%=400
      startyear%=457
      VDU5

      REPEAT
        FORi%=0TO10
          yrn%=startyear%-i%
          yearnumber%=yrn%-(yrn%>-1)

comes out as

x%=100
RIGHT$( RIGHT$( RIGHT$( y%=400
RIGHT$( RIGHT$( RIGHT$( startyear%=457
RIGHT$( RIGHT$( RIGHT$( VDU5

RIGHT$( RIGHT$( RIGHT$( REPEAT
RIGHT$( RIGHT$( RIGHT$( RIGHT$( FORi%=0TO10
RIGHT$( RIGHT$( RIGHT$( RIGHT$( RIGHT$( yrn%=startyear%-i%
RIGHT$( RIGHT$( RIGHT$( RIGHT$( RIGHT$( yearnumber%=yrn%-(yrn%>-1)

Doing the same thing into BB4W brings up the program as you would expect.

Finally I've been playing around with the jigsaw demonstration program. I load it into SDL and then try to Save As. The dialog box comes up as expected, but you cannot alter the file name - you can't delete it, change the drive letter, nothing. If I used a version of SDL saved on a different drive you can delete the whole file name and change it, but you can't change the drive letter. It just reverts back to whatever it was to begin with.

Mind you, changing the whole file name doesn't accomplish anything apart from alter the drive letter - it still retains the old file name but saved to a different drive!

And, of course, compiling the program to be stand-alone doesn't work either.

Grrrrr.

RichardRussell

Re: SDL problems

Post by RichardRussell »

KenDown wrote:
Wed 02 Sep 2020, 16:02
The first is a problem that others have mentioned before me: double-click on bbcsdl.exe and every so often it simply fails to start
Which version are you running? I thought that problem had gone away a long time ago, and I can't remember the last time it happened here.

The current version is 1.14a, and there are new releases every six weeks (BBCSDL is nowhere near stable, just as BB4W wasn't at an equivalent stage in its development).
I have a BASIC program in an .epub file. If I copy it and then try to paste it in SDL, you get some very odd results.
comes out as

Code: Select all

      x%=100
      RIGHT$(  RIGHT$(  RIGHT$(  y%=400
      RIGHT$(  RIGHT$(  RIGHT$(  startyear%=457
      RIGHT$(  RIGHT$(  RIGHT$(  VDU5
BBCSDL (please don't call it SDL - that's the Simple DIrectMedia Layer) is expecting plain text in the clipboard. RIGHT$( is &C2 which presumably has some formatting function in that proprietary file format.
I load it into SDL and then try to Save As. The dialog box comes up as expected, but you cannot alter the file name
I can't reproduce that here. Firstly double-check that you are running v1.14a, then post step-by-step instructions.
And, of course, compiling the program to be stand-alone doesn't work either.
BBCSDL doesn't 'compile' to a "stand-alone" executable in the way BB4W does (it's impossible, because of its dependence on SDL2.dll, SDL2_net.dll, SDL2_ttf.dll, zlib.dll and libfreetype-6.dll) but it does the best that it can: it builds (in Windows) a Zip file containing all the required components. In MacOS it does create a fully standalone .dmg file.
Grrrrr.
I understand that you are unhappy with BBCSDL, you've made that clear before. I can assure you that no time or effort is spared in an attempt to improve it and fix bugs: indeed I am often working on it through the night in a (probably vain) attempt to get it to an acceptable performance before my mental deterioration makes it impossible to do more. It is making me ill and shortening my life (probably a lot), but that's a price I am prepared to pay.

KenDown
Posts: 261
Joined: Wed 04 Apr 2018, 06:36

Re: SDL problems

Post by KenDown »

Ah. My bad. I was running an older version. I've upgraded and the Save as... problem seems to have gone away.

Thanks for clarifying about compiling. I want to put the jigsaw program on my wife's computer but she is not up to running it from the BBCSDL program.

I wouldn't say that I'm unhappy with BBCSDL - I haven't used it enough to reach that stage. I'm merely puzzled as I'm sure that the fault must be mine but can't work out what I'm doing wrong.

Likewise with the copy-and-paste from .epub. The RIGHT$( is from the non-breaking-space used for formatting ( ) what is puzzling is that when I copy into BB4W it works fine, but exactly the same paste (ie. Ctrl+C to copy and then Ctrl+V to paste into BB4W and then immediately into BBCSDL - or the other way round) produces such different results.

The only reason I've brought the subject up is that I've written an e-book and to make a particular point I want to include some computer graphics. I can't think of any way of providing the program ready to run, so to speak, so I have included the program listing in the text and suggest that readers download either BB4W or BBCSDL (if they don't have a Windows computer) and then copy and paste. With any luck it will drum up a few more users for you!

RichardRussell

Re: SDL problems

Post by RichardRussell »

KenDown wrote:
Sat 05 Sep 2020, 05:55
Ah. My bad. I was running an older version. I've upgraded and the Save as... problem seems to have gone away.
Please, before reporting an issue make sure that you are running the latest version. This applies to any software.
The RIGHT$( is from the non-breaking-space used for formatting ( ) what is puzzling is that when I copy into BB4W it works fine, but exactly the same paste (ie. Ctrl+C to copy and then Ctrl+V to paste into BB4W and then immediately into BBCSDL - or the other way round) produces such different results.
I'll keep this brief as my posts are seemingly not all being allowed, but it's not puzzling: it has to do with character encoding. BB4W uses ANSI encoding in which the code for a soft space is &A0, whereas BBCSDL uses UTF-8 encoding in which the code for a soft space is &C2 &A0. The &C2 is what gives rise to the RIGHT$(.
and suggest that readers download either BB4W or BBCSDL (if they don't have a Windows computer) and then copy and paste. With any luck it will drum up a few more users for you!
It would be better to suggest they download BBCSDL always, even if they have a Windows computer. That way they benefit from a completely free product, and consistency in the interface irrespective of the OS they run. With the recently released in-browser edition of BBCSDL you also have the option of linking to working code that they can run in their browser (if it's Edge or Chrome).

RichardRussell

Re: SDL problems

Post by RichardRussell »

KenDown wrote:
Sat 05 Sep 2020, 05:55
I was running an older version.
Help me out here (I would welcome contributions from others as well). One of the most problematical, and frustrating, aspects of developing and supporting a software product is not the technical side (designing, implementing, testing, debugging) but the 'human' component, i.e. anticipating and working with the behaviour of users!

When a product is relatively immature, with bugs being found and fixed, and new features added, quite frequently, it is obviously important that users upgrade whenever a new release is available. To that end I make sure that I advertise updates widely (typically here, the discussion group, the StarDot forum, the Raspberry Pi forum, the Raspberry BASIC forum, Facebook, Twitter and more) and describe the changes in detail.

In case bug fixes are not a sufficient motivation to upgrade (there may be an attitude of 'I haven't encountered the bug so why should I care?') I also try to add new features and/or include new and interesting example programs at each new release. Probably as much effort goes into the mechanics of the release process as did into the software modifications leading up to it!

Yet despite this some people (including you) don't upgrade. Why? Is it because you didn't know about it (very surprising given that most of the above sites, including this one, support automatic email notifications) or that you find it too inconvenient, or you don't think it's relevant to you, or what? If I could understand the 'psychology' of not updating perhaps I could find a way to overcome it.

KenDown
Posts: 261
Joined: Wed 04 Apr 2018, 06:36

Re: SDL problems

Post by KenDown »

Sorry for the delay in responding. It's partly that I don't recall receiving (or noticing) any notification about an update - which is not to say that there wasn't one - and partly that I'm still only dipping my toe into SDL. As I have the full version of BB4W and have put a lot of time and effort into becoming slightly proficient in its use, I am not in a hurry to abandon it! As I don't have a Mac and don't write programs for my phone, there is less incentive for moving to a cross-platform language.

Thanks for the information about the non-breaking spaces.

I am enjoying using the jigsaw program with SDL, though to get it to recognise any pictures other than the supplied one I had to change @usr$ to @dir$ in the browse routine.

RichardRussell

Re: SDL problems

Post by RichardRussell »

KenDown wrote:
Mon 19 Oct 2020, 03:09
I don't recall receiving (or noticing) any notification about an update
Only you can know how you managed to miss multiple notifications at the website, at this forum, at the Stardot forum, at the Raspberry Pi forum, at the DIscussion Group, at Facebook and at Twitter!
which is not to say that there wasn't one
New versions of BBC BASIC for SDL 2.0 are currently released every six weeks; so we're not talking about missing just one update. The next release is due this coming Friday, 23rd October.

Have you subscribed to be notified by email of new posts to the Announcements section of this forum? If not, why not? Can I suggest that you immediately put that right by going there and scrolling right down to the very bottom of the page, where you will find a Subscribe link:

subscribe.png
I am enjoying using the jigsaw program with SDL, though to get it to recognise any pictures other than the supplied one I had to change @usr$ to @dir$ in the browse routine.
That's presumably because you stored the additional picture(s) in @dir$ rather than in @usr$: you should not do that. @dir$ is the directory containing the program itself: you should assume it is read-only and it is also shared between users; @usr$ is guaranteed to be writable and to be specific to the current logged-in user.

So rather than changing @usr$ to @dir$ you should have stored your additional picture(s) in @usr$! Remember that in any case the supplied example programs typically cannot be modified: that's true in BBC BASIC for Windows (they are stored under C:\Program Files (x86) which is a protected location) and in the Android and iOS editions of BBC BASIC for SDL 2.0.

So, please, before doing anything else, restore the jigsaw.bbc program to how it was (it will in any case be overwritten when you next upgrade) and move your picture(s) to @usr$. You can, of course, trivially find out where @usr$ is by typing PRINT @usr$ at the immediate mode prompt.
You do not have the required permissions to view the files attached to this post.

RichardRussell

Re: SDL problems

Post by RichardRussell »

Image

RichardRussell

Re: SDL problems

Post by RichardRussell »

KenDown wrote:
Mon 19 Oct 2020, 03:09
As I have the full version of BB4W and have put a lot of time and effort into becoming slightly proficient in its use, I am not in a hurry to abandon it! As I don't have a Mac and don't write programs for my phone, there is less incentive for moving to a cross-platform language.
I don't think it was suggested that you "abandon" BBC BASIC for Windows; it still has its uses! For example if you want to give a program the Windows 'look and feel' (typically by using system-provided dialogue boxes and controls) then you must use BB4W, or if you want your program to output to a hardcopy printer, again BBCSDL isn't suitable.

But there are reasons to use 'BBC BASIC for SDL 2.0' other than for 'cross-platform' compatibility. For example some kinds of 2D graphics are much faster in BBCSDL than BB4W, because they can take advantage of hardware (GPU) acceleration. If I run 'aliens.bbc' with NALIENS=100 I get a frame rate of 60 fps in BBCSDL but only 6 fps in BB4W on the same machine!