Date   

Dual-platform programming

Richard Russell
 

It looks like I'll increasingly be writing code like this, to support multiple platforms:

      BB4W% = (INKEY(-256) = &57)

      IF BB4W% THEN
        SYS "SetWindowText", @hwnd%, Title$
        ON ERROR SYS "MessageBox", @hwnd%, REPORT$, "Error", 0 : QUIT
      ELSE
        SYS "SDL_SetWindowTitle", @hwnd%, Title$
        ON ERROR SYS "SDL_ShowSimpleMessageBox", 0, "Error", REPORT$, @hwnd% : QUIT
      ENDIF

Richard.



Re: BBC4W for a Linux

svein svensson
 

I'm interested, but i do not have linux at the moment.
Have not used it for years.
When there is some spare time, i will try to get one up and running from spare parts.

Svein


Re: BBC4W for a Linux

Richard Russell
 

---In bb4w@yahoogroups.com, <davidfeugey@yahoo.com> wrote :
> don't believe people that tell you it's just a packaging issue. It's not. It's a compiling
> issue too, because of the versions of the libs present on each OS.


That confuses me, because no libraries are included when it is compiled. The only things in the executable file I create are the object code of my assembler modules, the compiled object code from a C 'wrapper' module I have written, and the compiled object code from a customised version of SDL2_gfx. There will also presumably be some startup code which is automatically added by GCC, but I would not have expected it to be specific to the flavour of Linux.


So how is it a compiling issue? I realise that the libs present on each OS are likely to be platform-specific, but so long as they are dynamically linked at run-time I don't understand why it would require my code to be recompiled. Surely the ELF file format is standardised across Linux flavours?



> the question is 'do you target Linux users or BBC Basic users'.


Well, at this stage I am targeting only people who use *both*. What I am primarily interested in is getting feedback on the functionality of the software, reports of bugs and other performance issues, suggestions for possible additions and modifications, and help with porting existing BASIC programs to the new SDL platform. The only people who can do that are those who are already very familiar with both BBC BASIC and Linux. I am assuming that such people exist!


> But BBC Basic users will love to get BBC4L


So where are they? I have seen little evidence of any enthusiasm for it. Like you, I thought there would be some excitement about the new version, considering how often a Linux version or a Mac OS version of BBC BASIC have been asked for. Perhaps those people gave up waiting; to be fair I have always - honestly - said that I had no plans to create either, so that might have put them off. Somehow, although I was vaguely aware of SDL, I had not twigged until very recently that it would allow me to create a Linux version, and potentially also a Mac OS version, very easily.


> (and even pay for it).


It will be free. I am not interested in creating additional paid-for software; BBC BASIC for Windows is, and will remain, my only commercial product.



So I will wait, not very patiently, for somebody to show some interest in the (admittedly very early) version of 'BBC BASIC for Linux' that I uploaded yesterday. I want to know if it runs on anybody else's system, particularly if it's different from my own (32-bit Ubuntu 14.04.3). I want to know if it's what people want!


Richard.


Re: BBC BASIC for Linux

David Feugey
 

"I must say that there does seem to be a disparity between what the 'experts' at the forum said and what my 'common sense' predicts. They vehemently asserted that the only way to distribute a program, such that it would run on a wide range of Linux installations, was either to use some kind of 'package manager' or to supply source code."

They are so good that they don't even mention this :
https://build.opensuse.org/ https://build.opensuse.org/

One tool too make all your packages for all distributions. Don't need to be Open Source software.

Nota: don't believe people that tell you it's just a packaging issue. It's not. It's a compiling issue too, because of the versions of the libs present on each OS.

As I said before, there is no need for package. If someone really wants one, he'll simply propose you to do one. But as it's a package for developer, no one will ask... Your current version is OK.

Nota : the question is 'do you target Linux users or BBC Basic users'. Of course, some Linux users will complain about the closed source thing. But BBC Basic users will love to get BBC4L (and even pay for it).

"To try to placate the Linux mafia, I must state that this does not constitute a 'release'. To the best of my knowledge all the relevant licensing conditions have been complied with."

There is no legal issue. Of course, some people will always complain about the license (and once in GPL they'll complain about absence on GitHub, then complain on another thing). Real users will not care.

So do as Xojo or Wolfram Alpha: make your users happy

Nota: except Stallman, there is no open source Mafia in Linux core developers. Only some shouting users. I never heard someone as Linus saying that closed source software is shit. He just don't care (he's using OS X anyway, so he really don't care).

Bye.


Re: BBC4W for a Linux

Richard Russell
 

---In bb4w@yahoogroups.com, <yahoo@rtrussell.co.uk> wrote :
> This links to two SDL libraries, which will typically need to be installed before BBC BASIC
> will run. On Ubuntu the appropriate commands are:
> sudo apt-get install libsdl2-2.0-0
> sudo apt-get install libsdl2-ttf2.0-0


I should clarify that these commands are for 32-bit Ubuntu. If you are running a 64-bit OS you will need to append :i386 as follows:


sudo apt-get install libsdl2-2.0-0:i386
sudo apt-get install libsdl2-ttf2.0-0:i386


Richard.


Re: BBC BASIC for Linux

Richard Russell
 

---In bb4w@yahoogroups.com, <gordonsweet2000@yahoo.co.uk> wrote :
> I tested my FB programs on Ubuntu and my preferred Mint.... and most seem to work OK.
> Likewise strangely in a Puppy Linux.



I must say that there does seem to be a disparity between what the 'experts' at the forum said and what my 'common sense' predicts. They vehemently asserted that the only way to distribute a program, such that it would run on a wide range of Linux installations, was either to use some kind of 'package manager' or to supply source code. But surely since my compiled executable contains no static libraries, and as long as it is dynamically linked at run-time to the correct libraries for the particular Linux flavour and version, there is no reason why it shouldn't run?


There is probably only one way to resolve this and find the truth, and that is to try it. I have uploaded the current pre-alpha version of 'BBC BASIC for Linux', with some examples and libraries, here:


http://www.rtr.myzen.co.uk/bbclinux.zip http://www.rtr.myzen.co.uk/bbclinux.zip


This links to two SDL libraries, which will typically need to be installed before BBC BASIC will run. On Ubuntu the appropriate commands are:


sudo apt-get install libsdl2-2.0-0
sudo apt-get install libsdl2-ttf2.0-0



To try BBC BASIC use a command such as the following:


./bbcsdl examples/games/sudoku.bbc


To try to placate the Linux mafia, I must state that this does not constitute a 'release'. To the best of my knowledge all the relevant licensing conditions have been complied with.


Richard.


Re: BBC4W for a Linux

Gordon
 

Thanks for your interest Richard I tested my FB programs on Ubuntu and my preferred Mint that unlike Ubuntu does not demanding more than 1 GB of Ram and most seem to work OK. Likewise strangely in a Puppy Linux.

But for anyone conducting similar experiments as I remember you will first probably need to use Properties in Linux to click permission for your software to be run. I think all those on my site have the permission set OK.


Gordon


Re: BBC4W for a Linux

Richard Russell
 

---In bb4w@yahoogroups.com, <gordonsweet2000@yahoo.co.uk> wrote :
> could you please explain in simple terms and post your answer here. How is it even I
> managed to convert a number of my simple efforts in FreeBasic ( similar to Qbasic )
> into code acceptable by some Debian Linux like the Ubuntus


Well, as I have made clear, I am not knowledgable about Linux and therefore not qualified to comment.


However, from a purely technical perspective, my own experience is that there is no particular difficulty in compiling a program to run on the same machine. I assume that it is equally simple to run it on another machine running the same flavour and release of Linux (so I presume that the BBC BASIC code I have created would run equally well on another Ubuntu 14.04 machine for example).


Is that all you have done, or have you compiled code into a form which will run on a range of different Linux flavours and versions? If the FreeBasic compiler is able to create an executable which will run on a wide range of machines, without the end-user needing to install anything, that does seem to run contrary to what the 'experts' who commented at the new forum have claimed.


Richard.


Re: BBC BASIC for Linux gallery

Richard Russell
 

---In bb4w@yahoogroups.com, <sveinioslo@gmail.com> wrote :
> You have probably seen this list, but just in case.


I had not seen the list, but one has to ask how many of those are strictly 'legal' and how many were produced by a private individual rather than a 'company'? I do not have the support of a team of lawyers who can clarify the legal situation and if necessary raise a defence against any challenge. And I am not a faceless organisation which can weather any kind of criticism.


I would also want to point out that any software I might produce for Linux won't be "commercial" - I won't be charging for it or making money from it - but it would be "closed source" because I am not prepared to release the source of BB4W (it is far too embarrassingly awful!).


> Such an interesting project, a shame if it would be abandoned altogether.


In principle, the SDL version I have developed is equally appropriate for porting onto Mac OS-X or even Android (86), although there are very few machines running the latter OS. I am sure that there aren't any similar legal or moral issues with Mac OS, at least. So it won't be entirely wasted if I go down either of those routes, although buying a Mac is a very expensive way to proceed and not one I am personally enthusiastic about (although my wife, as an iOS user, is more keen).


Richard.


BBC4W for a Linux

Gordon
 

Being as you well know Richard a pure Amateur for many years in programming, could you please explain in simple terms and post your answer here. How is it even I managed to convert a number of my simple efforts in FreeBasic ( similar to Qbasic ) into code acceptable by some Debian Linux like the Ubuntus at http://www.sigord.co.uk/SubmitsLinux/LinuxSoftware.htm http://www.sigord.co.uk/SubmitsLinux/LinuxSoftware.htm using a free compiler at http://fbc.deltalabs.de/ http://fbc.deltalabs.de/

I used the compiler because I am very sceptical of my abilities to post all the required Unix code into a Ubuntu.

Gordon S.


Re: BBC BASIC for Linux gallery

svein svensson
 

FYI: Steam has 1500 games for linux, and they are not free of charge.

You have probably seen this list, but just in case.
https://en.wikipedia.org/wiki/List_of_proprietary_software_for_Linux

Such an interesting project, a shame if it would be abandoned altogether.

Merry christmas
Svein


Re: BBC BASIC for Linux gallery

Richard Russell
 

---In bb4w@yahoogroups.com, <davidfeugey@yahoo.com> wrote :
> The good question is do you prefer to listen to recriminations of some stupid Linux users
> (that most of the time are even not Linux users, just haters), or to the encouragements
> of you loyal users (the people who pay)?


I don't feel able to make the judgement between 'troll' and 'loyal user' that you do. I don't have a foolproof insight into what is 'right'. It seems to me that there is a danger of classing everybody who disagrees with one's own viewpoint as a troll, and everybody who agrees as loyal, but that isn't reasonable.


I confess to being highly ignorant of Linux, both the technical aspects and the 'politics'. Therefore my default position is to listen to everything I am told, especially when it comes from a self-declared 'expert' as was the case in this situation. I *did* do a web search to see if his opinion was widely shared, and it is.


The fact of the matter seems to be that distributing Closed Source applications for Linux *is* controversial, it's not just the opinion of a rogue 'troll'. There are legal issues, but even if those can be overcome (and I think they can in the case of BBC BASIC, although it's not as clear as I would like) one is still likely to be criticised.


Should I go ahead despite the questionable legality and expectation of criticism? My current feeling is that I shouldn't, but of course I am continuing to listen to what anyone has to say.


Richard.


Re: BBC BASIC for Linux gallery

David Feugey
 

Why does 'politics' (in this case the old Open Source versus Closed Source issue) have to intervene in what should ideally be a purely technical pursuit?


Not politics. Trolls. Who care anyway? I made press articles for years. While having many critics on forums (really a lot), I never had a single mail of protestation.

The good question is do you prefer to listen to recriminations of some stupid Linux users (that most of the time are even not Linux users, just haters), or to the encouragements of you loyal users (the people who pay)?

There is no politics. Just business. It's simpler .
Anyway, thanks for the cool screenshots...


BBC BASIC for Linux gallery

Richard Russell
 

As many of you will know, I have had to abandon (or at least mothball) BBC BASIC for Linux, which is very annoying. Although I have only been working on it for about three weeks it will be a great shame if it all goes to waste. Why does 'politics' (in this case the old Open Source versus Closed Source issue) have to intervene in what should ideally be a purely technical pursuit?


I can at least give you a taste of what might have been. At this link you will find a gallery of screen-shots from some of the example programs (as supplied with BB4W) running 'natively' (via SDL) on Ubuntu 14.04:


http://www.rtrussell.co.uk/bbclinux/gallery.html


Many of these programs required minor modifications to run under BBC BASIC for Linux, often for trivial reasons such as having to replace a SYS "Sleep" with a WAIT or because the syntax of *FONT is slightly different. In a few cases more involved changes were required, e.g. to replace a native Windows menu with a plain BASIC equivalent. But it's noteworthy that SKATERS.BBC runs perfectly with no changes required (BBC BASIC for Linux implements the 'CD quality' sound available in BB4W only via the HQSOUND library).


Richard.


BBC BASIC for Linux gallery

Richard Russell
 
Edited

As many of you will know, I have had to abandon (or at least mothball) BBC BASIC for Linux, which is very annoying.  Although I have only been working on it for about three weeks it will be a great shame if it all goes to waste.   Why does 'politics' (in this case the old Open Source versus Closed Source issue) have to intervene in what should ideally be a purely technical pursuit?

I can at least give you a taste of what might have been.  At this link you will find a gallery of screen-shots from some of the example programs (as supplied with BB4W) running 'natively' (via SDL) on Ubuntu 14.04:

http://www.rtrussell.co.uk/bbclinux/gallery.html

Many of these programs required minor modifications to run under BBC BASIC for Linux, often for trivial reasons such as having to replace a SYS "Sleep" with a WAIT or because the syntax of *FONT is slightly different.  In a few cases more involved changes were required, e.g. to replace a native Windows menu with a plain BASIC equivalent.  But it's noteworthy that SKATERS.BBC runs perfectly with no changes required (BBC BASIC for Linux implements the 'CD quality' sound available in BB4W only via the HQSOUND library).

Richard.



Just a test from a new member

Robert Allison
 

As a BBC Basic user dating back to waiting for my model B to be delivered for 6 months, it's nice to be back in familiar territory with a bunch of enthusiasts with a positive attitude.

Bob


File - reminder.txt

bb4w@...
 

(This message is posted automatically once a month)

If you are currently receiving emails from the group but would
prefer not to, you can change your email delivery settings. To
do that click on 'Edit Membership' above (if you are reading this
on the group's web page) or connect to the internet and click on
this link: http://groups.yahoo.com/group/bb4w/join

Scroll down to the section entitled Message Delivery and you will
see four radio-button options:

o Individual Email
o Daily Digest
o Special Notices
o Web Only

Select 'Special Notices' or 'Web Only', then confirm by clicking
Save Changes, and you won't be troubled by group emails (if you
select Special Notices you will still receive important messages
such as announcements of new versions of BBC BASIC for Windows).

Richard.


File - reminder.txt

bb4w@...
 

(This message is posted automatically once a month)

If you are currently receiving emails from the group but would
prefer not to, you can change your email delivery settings. To
do that click on 'Edit Membership' above (if you are reading this
on the group's web page) or connect to the internet and click on
this link: http://groups.yahoo.com/group/bb4w/join

Scroll down to the section entitled Message Delivery and you will
see four radio-button options:

o Individual Email
o Daily Digest
o Special Notices
o Web Only

Select 'Special Notices' or 'Web Only', then confirm by clicking
Save Changes, and you won't be troubled by group emails (if you
select Special Notices you will still receive important messages
such as announcements of new versions of BBC BASIC for Windows).

Richard.


Re: Physical screen memory

Richard Russell
 

---In bb4w@yahoogroups.com, <eatondrink@btinternet.com> wrote :
> I can not find a way in bb4w to reproduce this (it was how I generated quick coloured
> graphics without the need for assembly language), can anyone help?

You can certainly create a memory-mapped 'screen' that you can draw into using direct memory writes (e.g. using indirection) but it will only ever be a 'backbuffer', not the physical screen memory (which is not accessible to a user-mode program). Windows will 'blit' that backbuffer to the physical screen on demand.

BB4W comes with an example program which does exactly that: MANDEL.BBC. Although in the case of that program the memory-mapped display buffer is written using assembler code, it need not be. You could instead write to the memory using code such as ?xxxx=c% and it would work.

One of my recent projects annotates the output from an HD (GigE) camera by superimposing graphics drawn in exactly this way - and it's a time-critical program that runs at 60 frames-per-second full-screen! Here is an extract from the code of that application to demonstrate that what you propose is an entirely practical technique when the amount of graphics to be drawn isn't too great (this is drawing a pair of 'cross hairs'):

FOR P% = P%(I%)-MaxRadius% TO P%(I%)+MaxRadius%
?P% EOR= &FF
NEXT
FOR P% = P%(I%)-MaxRadius%*HIMAGE TO P%(I%)+MaxRadius%*HIMAGE STEP HIMAGE
?P% EOR= &FF
NEXT

Richard.


Physical screen memory

Ric
 

I am a newcomer to bb4w, but not a newcomer to BASIC. In the good old days of the BBC micro it was possible to access the PSM with ?&xxxx=c% to plot a coloured dot on the screen (all be it with a bit of decoding for MODE 2), I can not find a way in bb4w to reproduce this (it was how I generated quick coloured graphics without the need for assembly language), can anyone help?

3141 - 3160 of 23735