Topics

Problem with ellipsefill on Android using BBCSDL 1.00a

LifesVoyager
 

FYI

Running Android 8.1.0 on a XiaoMi phone,  ellipses.BBC works perfectly

Richard Russell
 

On Fri, Feb 8, 2019 at 09:45 AM, Ken Orr wrote:
I am afraid it fails on "modern" android and Windows too.
Before or after the change from 3 line segments to 4?  Failure on Windows is likely to be unrelated, unless (very unusually) your display is configured for 16-bit colour.  You might want to check whether any updated graphics drivers are available for your PC.

  I have attached screenshots of ellipses.bbc
No you haven't, because attachments are not supported (I always access the group using its web interface, not by email)!  If you want to show screenshots please upload them to a suitable public web space and post a link.

gav
 

Sorry for the blank message earlier. I was about to reply when I got called away and somehow my post was sent.

I must admit that I've only been following this thread at a distance and I've not been monitoring the finer details of the suggested fixes, due to an illness in the family.

Can someone tell the exactly where to change the line segment value from 3 to 4 please so I can check if that helps. What file is to be changed the program or the ellipses library? And which line?

I'm currently sat waiting in a hospital car park so can try the edit out while I'm here.

Thanks

Gavin



Sent from Samsung Mobile on O2

-------- Original message --------
From: Richard Russell <news@...>
Date: 08/02/2019 10:11 (GMT+00:00)
To: bb4w@groups.io
Subject: Re: [bb4w] Problem with ellipsefill on Android using BBCSDL 1.00a

On Fri, Feb 8, 2019 at 09:45 AM, Ken Orr wrote:
I am afraid it fails on "modern" android and Windows too.
Before or after the change from 3 line segments to 4?  Failure on Windows is likely to be unrelated, unless (very unusually) your display is configured for 16-bit colour.  You might want to check whether any updated graphics drivers are available for your PC.

  I have attached screenshots of ellipses.bbc
No you haven't, because attachments are not supported (I always access the group using its web interface, not by email)!  If you want to show screenshots please upload them to a suitable public web space and post a link.

Richard Russell
 

On Fri, Feb 8, 2019 at 11:15 AM, gav wrote:
Can someone tell the exactly where to change the line segment value from 3 to 4 please so I can check if that helps.
There are eight  calls to bezierColor() in the PROCellipsefill section of the ellipse.bbc library:

      SYS "GFX_bezierColor",@memhdc%,v%%,   w%%,   4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+6, w%%+6, 4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+12,w%%+12,4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+18,w%%+18,4,3,Z%
      SWAP Z%,@hpal%!(@vdu%?67*4)
      SWAP @vdu%?65,@vdu%?67
      PLOT 143,X%,Y%
      SYS "GFX_bezierColor",@memhdc%,v%%,   w%%,   4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+6, w%%+6, 4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+12,w%%+12,4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+18,w%%+18,4,3,Z%

Please note that if you edit these lines 'in situ' the change will only last for the current session.  As soon as you restart BBCBasic it will revert to the standard library.  For any 'serious' testing I would copy both 'ellipse.bbc' (the library) and 'ellipses.bbc' (the demo program) into the @usr$ folder and edit the copied ellipses.bbc to load the library from @usr$ rather than @lib$.  That way you can make changes which will 'stick'.

gav
 

Thanks for the clarification. Copied to @usr$ and those changes fixed it on my phone.

Gavin



Sent from Samsung Mobile on O2

-------- Original message --------
From: Richard Russell <news@...>
Date: 08/02/2019 11:51 (GMT+00:00)
To: bb4w@groups.io
Subject: Re: [bb4w] Problem with ellipsefill on Android using BBCSDL 1.00a

On Fri, Feb 8, 2019 at 11:15 AM, gav wrote:
Can someone tell the exactly where to change the line segment value from 3 to 4 please so I can check if that helps.
There are eight  calls to bezierColor() in the PROCellipsefill section of the ellipse.bbc library:

      SYS "GFX_bezierColor",@memhdc%,v%%,   w%%,   4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+6, w%%+6, 4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+12,w%%+12,4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+18,w%%+18,4,3,Z%
      SWAP Z%,@hpal%!(@vdu%?67*4)
      SWAP @vdu%?65,@vdu%?67
      PLOT 143,X%,Y%
      SYS "GFX_bezierColor",@memhdc%,v%%,   w%%,   4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+6, w%%+6, 4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+12,w%%+12,4,3,Z%
      SYS "GFX_bezierColor",@memhdc%,v%%+18,w%%+18,4,3,Z%

Please note that if you edit these lines 'in situ' the change will only last for the current session.  As soon as you restart BBCBasic it will revert to the standard library.  For any 'serious' testing I would copy both 'ellipse.bbc' (the library) and 'ellipses.bbc' (the demo program) into the @usr$ folder and edit the copied ellipses.bbc to load the library from @usr$ rather than @lib$.  That way you can make changes which will 'stick'.

lettersquash <j.r.freestone@...>
 

I changed all the relevant fifth params to 4. Unfortunately, this cures the issue only 'empirically'. If I choose a different number of ellipses (I made the "A%*PI/20" and "MOD20" to use a % variable instead of 20), the angles change and ellipses still fail at particular angles.

lettersquash <j.r.freestone@...>
 

Oops, posts coming thick and fast, I didn't see this:
Please note that if you edit these lines 'in situ' the change will only last for the current session.  As soon as you restart BBCBasic it will revert to the standard library.  For any 'serious' testing I would copy both 'ellipse.bbc' (the library) and 'ellipses.bbc' (the demo program) into the @usr$ folder and edit the copied ellipses.bbc to load the library from @usr$ rather than @lib$.  That way you can make changes which will 'stick'.
So, you never know...

lettersquash <j.r.freestone@...>
 

OK, so I did close BBCSDL before trying different values of n% (number instead of 20 as above), and it failed on other numbers.

But being Android, perhaps it didn't quit, because when I just started it again and checked, the changes to ellipse.bbc in @lib% remain.

So if I understand right, that's bad news. With the "4 instead of 3" fix, if you try 12 instead of 20 (say) in ellipses.bbc, it fails again. 20 just happens to work out to avoid the error.

lettersquash <j.r.freestone@...>
 

Yeah, it hadn't quit. Killing the process and re-running BBC BASIC, as you say, reinstates the 3, but my tests were with a 4, and some angles still fail. Sorry to say.

lettersquash <j.r.freestone@...>
 

As I said earlier, something else is quite different depending on the device or OS or something, because on my Galaxy Tab, each ellipse is erased before the next one is drawn (without any leaking, at least at those defaults - I haven't edited either file on that machine), whereas on my phone they are left, so the next one overlaps part of the pattern and a sort of elliptical spiral staircase emerges. I expect this is what the code is supposed to do, leave them, but I don't know what the second call, to PROCellipse, actually does. I'm guessing it just draws an outline round the already drawn ellipse. So on the Tab, perhaps that's not working either and is filling it in background colour or something. But the Tab is ancient.

DaveinSpain
 

It fails on my Android v7.0 phone too.
After the 4 to 3 mod it seemed to be okay.
I then tried changing the short axis in 'elipses.bbc' from 80 to 480, effectively  making it draw circles and the fault reappeared.
Tried making the line thicker but elipses only uses single pixel lines.
Dave N

Richard Russell
 

On Fri, Feb 8, 2019 at 12:49 PM, lettersquash wrote:
the angles change and ellipses still fail at particular angles.
That's what I would have expected.  It would still be interesting to know whether the 'gaps' through which the flood-fill is apparently leaking are at the junctions between the four Bezier curves, or between the straight-line segments comprising the Bezier curves.  The former would be amenable to a workaround of 'plugging the gaps' but the latter not.  The way I would probably make that determination would be to colour the four Bezier curves differently (that would involve changing the flood-fill to the more common 'fill while background' type rather than the 'fill until foreground' used by the ellipse library).

LifesVoyager
 

Also

Running Android 8.0.2 on a different XiaoMi phone,  ellipses.BBC works perfectly

Richard Russell
 

On Fri, Feb 8, 2019 at 01:35 PM, DaveinSpain wrote:
I then tried changing the short axis in 'elipses.bbc' from 80 to 480, effectively  making it draw circles and the fault reappeared
Of course a circle has a greater circumference than the ellipse (and hence the straight-line segments comprising the Bezier curves are longer) so can I assume you tried increasing the number above 4?  I did say to try increasing it "from 3 to 4 (or more)" so to keep the segments short - if indeed that helps - implies increasing the number pro-rata with the circumference.

LifesVoyager
 

Sorry.  That should be  Android 5.0.2

Richard Russell
 

I've uploaded BBCSDL v1.00c (Android only) to make it easier for people to do some more testing without needing to edit the ellipse library themselves.  In this version I've set the number of line segments per Bezier curve to six (twice the original number) and also done some more tidying up.  For example there is now error trapping to catch the possibility of it being interrupted whilst in an unstable state.

I'd like as many people with Android devices as possible to respond to the following questions:

1.  Is six line segments per Bezier working better than, worse than or no different from the original three?
2.  For those who experimented with four segments, is six segments better, worse or no different?
3.  Does it seem that increasing the number of line segments results in a general improvement, or does it simply alter the angles at which the flood-fill 'leaks'?

Unfortunately I cannot provoke it to fail on any of my Android devices (six in all) so I am reliant on these reports in order to make any progress.

DaveinSpain
 

Richard, I have been experimenting, with some very strange results!
I have two Android machines. One I can't make go wrong, the other always goes wrong - a Blackview with v7.0

I have modified "elipses.bbc" with:- a=GET : CLG after the A% = A%+1 increment.
I have modified "elipse.bbc" with variables for the eight "4,3" in the relevant places.
The same mod on both machines

I now have "stop motion"  and get different results on each.
I have recorded the faulty one and am enclosing it - although only you, Richard, will be able to receive it, I believe.

Regards, Dave N

Richard Russell
 

On Sat, Feb 9, 2019 at 08:37 PM, DaveinSpain wrote:
I have recorded the faulty one and am enclosing it - although only you, Richard, will be able to receive it, I believe.
I have explained before that I view the group using its web interface which does not support attachments.

Have you tried version 1.00c and if so what are your findings in respect of the questions I asked?

John Alfred
 

I meant to say a while back, that ellipses.bbc is running fine on my old "Samsung Galaxy S4 mini GT-I9195".
The Android version is 4.4.2 and the BBC BASIC version is v1.00c.
I haven't experimented with any parameters, and just run the program 'as is'.

John A