"Unfixable bug" in BBC B Elite

reminisce about bbc micro & electron games like chuckie egg, repton, elite & exile

Related forum: adventures


SteveF
Posts: 429
Joined: Fri Aug 28, 2015 8:34 pm

"Unfixable bug" in BBC B Elite

Postby SteveF » Tue Aug 15, 2017 7:18 pm

I was reading lwn.net the other day and came across this in the comments:
nix wrote:I can think of two pieces of software that were completed. TeX, because Knuth decreed it (and bugfixes didn't stop even then), and BBC B Elite, which must be considered to eventually have been completed because there was literally no more RAM in which to fix the single remaining known bug: IIRC, it needed three bytes, and after many sweeps through the code, optimizing each time, there was no more fat to be wrung out of it.

(from https://old.lwn.net/Articles/730704/)

I've done a quick spot of searching on the forums here and Google and I haven't been able to find this story anywhere. Does anyone know the details?

paulb
Posts: 764
Joined: Mon Jan 20, 2014 9:02 pm

Re: "Unfixable bug" in BBC B Elite

Postby paulb » Tue Aug 15, 2017 7:35 pm

SteveF wrote:I was reading lwn.net the other day and came across this in the comments:
nix wrote:I can think of two pieces of software that were completed. TeX, because Knuth decreed it (and bugfixes didn't stop even then), and BBC B Elite, which must be considered to eventually have been completed because there was literally no more RAM in which to fix the single remaining known bug: IIRC, it needed three bytes, and after many sweeps through the code, optimizing each time, there was no more fat to be wrung out of it.

(from https://old.lwn.net/Articles/730704/)

I've done a quick spot of searching on the forums here and Google and I haven't been able to find this story anywhere. Does anyone know the details?


I've not heard that before, or I don't remember hearing about it, but I imagine that the guy who did the enhanced version of Elite (EliteA?) might have something to say about it. Of course, Braben and Bell could have declared it finished and thus the bug becomes a feature, I suppose.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Wed Aug 16, 2017 9:37 am

Never heard that before either. There's some mention of a known bug in Elite in the articles about Star Clash here, but it doesn't specify its nature (though there's a suggestion that it was to do with the way the scanner plotted ships' positions). I wonder who "nix" is, and where this came from?

paulb
Posts: 764
Joined: Mon Jan 20, 2014 9:02 pm

Re: "Unfixable bug" in BBC B Elite

Postby paulb » Wed Aug 16, 2017 9:59 am

Rich Talbot-Watkins wrote:I wonder who "nix" is, and where this came from?


He (gender assumed) is a regular at LWN.net, but unlike others his identity hasn't been revealed by various means. (Although I think that the message should be more important than the identity, the custom for using opaque identities on that and other sites is counterproductive in that it tends to encourage some antisocial habits, not that nix is really one of those people.) Maybe I'll post a response and ask for more details. :wink:

User avatar
Wouter Scholten
Posts: 154
Joined: Wed May 02, 2001 10:14 pm
Location: NL
Contact:

Re: "Unfixable bug" in BBC B Elite

Postby Wouter Scholten » Wed Aug 16, 2017 1:15 pm

SteveF wrote:I was reading lwn.net the other day and came across this in the comments:
nix wrote:I can think of two pieces of software that were completed. TeX, because Knuth decreed it (and bugfixes didn't stop even then), and BBC B Elite, which must be considered to eventually have been completed because there was literally no more RAM in which to fix the single remaining known bug: IIRC, it needed three bytes, and after many sweeps through the code, optimizing each time, there was no more fat to be wrung out of it.

(from https://old.lwn.net/Articles/730704/)

I've done a quick spot of searching on the forums here and Google and I haven't been able to find this story anywhere. Does anyone know the details?


Don't know what this bug refers to but I did a printout in 1984 or 1985 and the pixel drawing code for example can definitely be improved. The code can be improved in other places too I remember, definitely by more than 3 bytes. I'd need to look up the disassembly, which I still have, though I'm not sure if I still have my notes on improving that code that I wrote in a notebook (I did write various comments with the disasembly). I do have my own plotting code from around the same time that I've long ago transferred to the PC so I could compare them (in October or so, probably no time for it sooner). Angus Duggan did a lot of extension and improvements but not sure what he took out and of course there is the issue of swapping out stuff with the disk version, so for true improvement it needs to be in the non-swapped code (well, unless the bug is in a swapped part...) but that's moot because as I said, the code can definitely be improved by more than 3 bytes.

It's more likely that a bug remained and they said "It's good enough". Such are the choices of releasing (commercial) software.

User avatar
jonb
Posts: 2046
Joined: Sat May 21, 2011 12:42 pm
Location: South Coast of England

Re: "Unfixable bug" in BBC B Elite

Postby jonb » Wed Aug 16, 2017 1:24 pm

That's interesting, Wouter. Do you think there is scope for performance improvements?

User avatar
Wouter Scholten
Posts: 154
Joined: Wed May 02, 2001 10:14 pm
Location: NL
Contact:

Re: "Unfixable bug" in BBC B Elite

Postby Wouter Scholten » Wed Aug 16, 2017 2:51 pm

jonb wrote:That's interesting, Wouter. Do you think there is scope for performance improvements?


It was my intention to speed it up and make it smaller, not so much for use but more as an exercise to improve the code and to see what is possible. I don't think small code optimisations in that code will be noticeable in practice, I think other stuff would be more noticeable (like rearranging the draw/erase order, to make it less flickery on screen without changing actual speed). Perhaps I will have a look tonight at the disassembly, I will go to where it is stored tonight, so if I can quickly find it, then I will have a look.

If no further reply, then I will tell/show end of Sept or in Oct.

User avatar
kieranhj
Posts: 489
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: "Unfixable bug" in BBC B Elite

Postby kieranhj » Thu Aug 17, 2017 10:00 am

Does anyone feel like making the Elite source buildable in BeebAsm (or similar) as we have with Thrust and Exile? :-k

User avatar
davidjefferies
Posts: 10
Joined: Thu Jul 14, 2016 2:40 pm

Re: "Unfixable bug" in BBC B Elite

Postby davidjefferies » Thu Aug 17, 2017 5:27 pm

Rich Talbot-Watkins wrote:Never heard that before either. There's some mention of a known bug in Elite in the articles about Star Clash here, but it doesn't specify its nature (though there's a suggestion that it was to do with the way the scanner plotted ships' positions). I wonder who "nix" is, and where this came from?


I remember this from BITD and always wondered whether Julian Bushell really did just reverse engineer Elite, strip out all the trading bits and release it as Star Clash as Superior Software claimed.

Now we have the (slightly) commented source code to Elite I thought we might be able to find out. I disassembled a memory dump of Star Clash (while doing some dogfighting) and searched through the code for some instruction sequences that are now known to do the 3D plotting and scanner from the Elite source code.

Result: I couldn't find any instruction sequences that matched between the two games. Admittedly it wasn't an exhaustive test (I probably tried 15 or 20 difference code sections) but it does seem to indicate that Julian copied the look of Elite rather than ripping off the machine code verbatim.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Thu Aug 17, 2017 8:53 pm

I always felt that Star Clash was probably written independently of Elite, rather than poaching code verbatim. For a start, the rendering just looks totally different. It doesn't have such a good frame rate as Elite when there's a lot going on, but there's less flicker, and the ship designs are rather more simplistic. There are many ways to write 3D code and I don't doubt that Julian Bushell did it differently to Bell and Braben (and probably not quite as well).

Stylistically it's certainly a lot like Elite, particularly the scanner (although the game itself is rather different). But I always felt it was a bit rich that Acornsoft protested so much when they'd made a business out of releasing unlicensed conversions of arcade games (Snapper/Pacman, Hopper/Frogger, Planetoid/Defender, Carousel/Carnival, Bouncer/Q*Bert, etc etc etc), and had even been forced to make changes due to IP infringement. Not sure why they didn't compare the source code of the two titles if they were so certain, though we all know that the real winners would've been the lawyers.

User avatar
Wouter Scholten
Posts: 154
Joined: Wed May 02, 2001 10:14 pm
Location: NL
Contact:

Re: "Unfixable bug" in BBC B Elite

Postby Wouter Scholten » Fri Aug 18, 2017 6:09 am

Rich Talbot-Watkins wrote:There are many ways to write 3D code and I don't doubt that Julian Bushell did it differently to Bell and Braben (and probably not quite as well).


Aha, why "probably not quite as well"? I see no reason to asume that...

Rich Talbot-Watkins wrote:Stylistically it's certainly a lot like Elite, particularly the scanner (although the game itself is rather different). But I always felt it was a bit rich that Acornsoft protested so much when they'd made a business out of releasing unlicensed conversions of arcade games (Snapper/Pacman, Hopper/Frogger, Planetoid/Defender, Carousel/Carnival, Bouncer/Q*Bert, etc etc etc), and had even been forced to make changes due to IP infringement. Not sure why they didn't compare the source code of the two titles if they were so certain, though we all know that the real winners would've been the lawyers.


It was Superior who protested, not Acornsoft, right? The original people from Acornsoft were at that point likely not involved any more. But Superior also based a lot of their early games on classics.

As to the scanner, that was apparently not an idea by Braben and Bell but someone from Acornsoft... (Someone mentioned it in a comment somewhere with a story on Elite, I saw it recently but forgot where, shouldn't be too hard to find). I have received comments that the history of Elite is different than portrayed, though details are elusive (mainly because of the inane libel laws in the UK!). I suspect they had more input from people at esp. Acornsoft, than is told... What is clear from what Braben tells about Elite, is that he is a story teller, and not someone who cares a lot about details and getting it right. He is I would wager the person behind the story in Spufford's badly researched "Backroom boys". At least badly researched w.r.t. the part with Elite. My sources tell me that Spufford had 1 source for that part of the book upon almost everything in that part of the book was based. Others whom he consulted later were quite annoyed at all the inaccuracies but it was too late, at least in that for Spufford the deadline was more important than facts.

By the way, I found my Elite disassembly with comments, there are almost no comments with the line drawing code on the disassembly itself, my notebook with improvements on the general drawing code is either lost, or somewhere else, I will look further. There are a few loose pages with my notes on a general drawing code but all snippets (and could be my own drawing code but it doesn't matter, would be a reference). I noted the bytes/cycles saved, but I'm not sure if that is compared to the Elite code or with my own earlier implementation, I would need to check. But there is also a fairly complete section which is definitely about just improving the Elite code, with analysis and improved code for the horizontal drawing. I had a look at it, seems to be OK from checking if I didn't make mistakes. I saved quite a lot of bytes and made the subroutine a lot faster. There are several iterations of improvements so I need to check which is which but that particular section of code in Elite is not so impressive. So need to check which iteration of improvement but on my notes it says: original 29 bytes and 33,34 cycles (or 34,35 cycles, I mention both on that page), my new version: 17 bytes and 23,24 cycles. [ Those numbers are for the code in the subroutine that I altered, there is a bit more code that I denoted with 'left, middle,right' that I left unchanged, so the total speedup would not be 1.5 times, but more on this later ]

So way more than 3 bytes saved there already.

I will make some pictures later, this will probably come after a trip so end of Sept. or in Oct.

User avatar
daveejhitchins
Posts: 3624
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham

Re: "Unfixable bug" in BBC B Elite

Postby daveejhitchins » Fri Aug 18, 2017 7:00 am

I don't know about anyone else . . . but I'm really enjoying this thread =D>

Exciting prospects!

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

User avatar
jonb
Posts: 2046
Joined: Sat May 21, 2011 12:42 pm
Location: South Coast of England

Re: "Unfixable bug" in BBC B Elite

Postby jonb » Fri Aug 18, 2017 8:28 am

Me too, but most of all I am intrigued at what this bug actually is.

Right now I wish I was familiar with 6502 programming, or indeed had enough interest to become familiar with it. I prefer the Z80 (and no, I don't want to kick off a debate about the two, at least, not in this thread).

Whatever the Elite bug is, it must be very subtle, if it exists.

User avatar
kieranhj
Posts: 489
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK

Re: "Unfixable bug" in BBC B Elite

Postby kieranhj » Fri Aug 18, 2017 9:38 am

jonb wrote:Me too, but most of all I am intrigued at what this bug actually is.

Whatever the Elite bug is, it must be very subtle, if it exists.

We could just ping David Braben on Twitter and ask him? I also have his Frontier email address through work.

User avatar
jonb
Posts: 2046
Joined: Sat May 21, 2011 12:42 pm
Location: South Coast of England

Re: "Unfixable bug" in BBC B Elite

Postby jonb » Fri Aug 18, 2017 9:44 am

..but will he remember? And don't forget, he didn't write all of it. Maybe we need to ask Ian Bell, too.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Fri Aug 18, 2017 9:46 am

Wouter Scholten wrote:Aha, why "probably not quite as well"? I see no reason to asume that...

Just judging by what you can outwardly observe. Elite runs at a better frame rate, with more complicated ship designs. Star Clash's geometry is rather more simplistic, and it really starts to chug when there's a bit of action on screen - that implies to me that its transformation (or rendering) code is not as optimized as Elite's.

I wonder if Star Clash performs double buffering because it seems to have rather less flicker, but clearing the back buffer would certainly lead to a constant reduced frame rate too.

Wouter Scholten wrote:It was Superior who protested, not Acornsoft, right? The original people from Acornsoft were at that point likely not involved any more. But Superior also based a lot of their early games on classics.

Yeah, the same double standard still applies I think! If it could have been proved that there was wholesale lifting of code from Elite, they would have had a perfectly valid case. But I'm not convinced they had any such proof, they were just making legal threats to stop Star Clash intruding on their territory. Back then, games were cloned all the time and I have no idea if there was legal protection against that, or precedent for successfully claiming infringement on different games with similar features.

Like David, I'd love to know if there were any such routines copied from Elite (as Superior claimed), or even just algorithms lifted and reimplemented (multiplication/division techniques, line clipping/rendering, etc). As I said, the end results look markedly different in each game, so I'd be surprised.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Fri Aug 18, 2017 9:49 am

jonb wrote:..but will he remember? And don't forget, he didn't write all of it. Maybe we need to ask Ian Bell, too.

Matt Godbolt has had friendly contact with Ian Bell in the past (asking for permission to host Elite as the default loaded jsbeeb game), so maybe he can ask. I think Bell was responsible for rather more of the 3D code than Braben (who was more concerned with the trading side), so he may well be the better of the two to ask anyway.

User avatar
danielj
Posts: 5136
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: "Unfixable bug" in BBC B Elite

Postby danielj » Fri Aug 18, 2017 9:53 am

Lots of source code on Ian Bell's page:
http://www.elitehomepage.org/archive/index.htm

d.

User avatar
davidjefferies
Posts: 10
Joined: Thu Jul 14, 2016 2:40 pm

Re: "Unfixable bug" in BBC B Elite

Postby davidjefferies » Fri Aug 18, 2017 11:51 am

Rich Talbot-Watkins wrote:[

Like David, I'd love to know if there were any such routines copied from Elite (as Superior claimed), or even just algorithms lifted and reimplemented (multiplication/division techniques, line clipping/rendering, etc). As I said, the end results look markedly different in each game, so I'd be surprised.


I agree the games look quite different and the framerate is definitely worse in StarClash which backs up Julian's claim that he wrote it himself. If Braben & Bell had proof he'd lifted the code I'd have expected them to produce it rather than referring to an unidentified bug.

If you take the disassembly of Elite from here http://www.elitehomepage.org/archive/a/d4090010.txt then it's easy to find little snippets of line drawing code such as this

Code: Select all

A5 35                   LDA &35      \ Y1
4A                      LSR A      \ build screen index
4A                      LSR A
4A                      LSR A
09 60                   ORA #&60   \ high byte of screen memory set to page &60+ Y1/8
85 08                   STA &08      \ SC+1
A5 35                   LDA &35      \ Y1
29 07                   AND #7      \ build low
A8                      TAY       \ row in char
8A                      TXA       \ X1
29 F8                   AND #&F8   \ keep upper 5 bits
85 07                   STA &07   \ SC  \ screen lo
8A                      TXA       \ X1
29 07                   AND #7      \ keep lower 3 bits
AA                      TAX       \ index mask


and find the same instructions in Ian Bells source code e.g.

Code: Select all

 2050LDAY1:LSRA:LSRA:LSRA:ORA#&60:STASCH:LDAY1:AND#7:TAY:TXA:AND#&F8:STASC
 2060TXA:AND#7:TAX
 


But I haven't been able to find any similar code in the StarClash disassembly. Of course the programmer could have obfuscated it but it would have been hard to change all the constants and instruction orders for this stuff. Harder than writing it yourself probably!

User avatar
davidjefferies
Posts: 10
Joined: Thu Jul 14, 2016 2:40 pm

Re: "Unfixable bug" in BBC B Elite

Postby davidjefferies » Fri Aug 18, 2017 3:37 pm

from recollection (I can't remember where - perhaps the source code to Elite The New Kind) one of the important optimisations that Braben (see here for who coded what http://www.elitehomepage.org/faq.htm) did in the original ship plotting routines was realising that it's OK for the ships matrices to not be orthoganol and that Sin(X) == X for small values of X. So instead of rotating each ship point in the ship correctly using Sin(angle) and Cos(angle) he just added or subtracted angle from each vector. After doing this several times the ship starts to look elongated as its matrix is non-uniformly scaled and so the code calls a Tidy function that makes the matrix orthoganol again. This is why the ships sometimes look weirdly scaled.

Apparently it was this realisation that meant the ship rotating and plotting code was viable. The rest of the 3D maths and line drawing code was readily available and could be coded by any competent programmer but without that realisation it wouldn't have been fast enough to use in a game.

User avatar
jonb
Posts: 2046
Joined: Sat May 21, 2011 12:42 pm
Location: South Coast of England

Re: "Unfixable bug" in BBC B Elite

Postby jonb » Fri Aug 18, 2017 3:56 pm

IIRC, they also decided to precalculate lookup tables for sin() and cos() (?) with a circle divided up into 265 "degrees", which was neat (although not as neat as the galaxy generation method).

User avatar
davidjefferies
Posts: 10
Joined: Thu Jul 14, 2016 2:40 pm

Re: "Unfixable bug" in BBC B Elite

Postby davidjefferies » Fri Aug 18, 2017 4:24 pm

indeed, here's the bit from the Elite sources that generates the table

Code: Select all

 4700.SNE:]
 4720FORI%=0TO31:N=ABS(SIN(I%/64*2*PI)):IFN>=1 I%?O%=FF:ELSEI%?O%=INT(256*N+.5)
 4730NEXT
 


It only needs a sine table because cosine(x) == sin(x + PI/2). It uses 32 entries and each entry is scaled between 0 and 255.

I think this table is only used for drawing the planets because sine and cosine aren't needed for the 3D maths for the ships because they use the trick where sin(x) == x

edit:
Looking at the Elite A New Kind source code seems to verify they don't need sine or cosine for the 3D maths for rotating the ships. Here's the rotate code

Code: Select all

void rotate_vec (struct vector *vec, double alpha, double beta)
{
   double x,y,z;
   
   x = vec->x;
   y = vec->y;
   z = vec->z;

   y = y - alpha * x;
   x = x + alpha * y;
   y = y - beta * z;
   z = z + beta * y;
   
   vec->x = x;
   vec->y = y;
   vec->z = z;
}

where alpha and beta are the deltas for pitch and roll.
Normally you'd expect that function to look more like

Code: Select all

    x' = x * cos(alpha) − y * sin(alpha)
    y' = x * sin(alpha) + y * cos(alpha)
    etc


but they use the propery sin(alpha)==alpha for small values of alpha thereby negating the need for any trig. They then re-orthogonalise the matrices after a set number of frames to stop the scale becoming too non-uniform.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Mon Aug 21, 2017 8:17 am

That code is actually making use of a peculiar thing called the Minsky Recurrence.

Note these lines:

Code: Select all

   y = y - alpha * x;
   x = x + alpha * y;

The calculation for x is actually making use of the new value for y, not the original one. This is completely stable, and repeats periodically, but doesn't rotate in a perfect circle, but something more like a sheared ellipse.

More on the Minsky recurrence here:
http://brainwagon.org/2010/08/09/drawin ... in-minsky/

And, just to clarify, the fact that sin(x) ≈ x for small angles isn't the biggest part of the optimization there (because it just saves a sine table lookup); it's more that cos(x) ≈ 1 for small angles, meaning you can just remove that term of the calculations completely. With the Minsky recurrence, it stabilises the rotation, stopping it from spiralling away from the centre, at the cost of shearing the transform.

User avatar
BigEd
Posts: 1393
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: "Unfixable bug" in BBC B Elite

Postby BigEd » Mon Aug 21, 2017 8:41 am

(great link to brainwagon. There's an online in-browser Minskytron here.)

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Mon Aug 21, 2017 11:07 am

I was trying to understand the maths behind this a bit more.

Starting with the two equations:

Code: Select all

x' = x - ey
y' = y + ex'

and expanding out, we get:

Code: Select all

x' = x - ey
y' = y + e(x - ey)
   = y + ex - e^2 y
   = y(1 - e^2) + ex


In matrix form this can be written:

Code: Select all

[ x' ]   =  [ 1   -e   ] [ x ]
[ y' ]      [ e  1-e^2 ] [ y ]

... which has a determinant of 1, hence the stability.

And that transform happens to be the result of two shears:

Code: Select all

[ 1   -e   ] = [ 1  0 ] [ 1 -e ]
[ e  1-e^2 ]   [ e  1 ] [ 0  1 ]


Not sure if that's relevant or not, but it's a strange coincidence if not, since the final transform shows a kind of shearing effect. Anyone shed any more light on this?

User avatar
jonb
Posts: 2046
Joined: Sat May 21, 2011 12:42 pm
Location: South Coast of England

Re: "Unfixable bug" in BBC B Elite

Postby jonb » Mon Aug 21, 2017 3:12 pm

I set email to Ian Bell to ask if he knew what "the bug" was.

He kindly replied, saying:

The only bug I remember in BBC Elite was the no-asteroids-in-disk version that affected the first disk print run, and that did not require freed memory to fix. For a bug to have had no room to fix it would have to have been BBC Cassette Version and we could have found three bytes there if we had had too, so I think this is a myth.


Kind of hard to argue with that.

SteveF
Posts: 429
Joined: Fri Aug 28, 2015 8:34 pm

Re: "Unfixable bug" in BBC B Elite

Postby SteveF » Mon Aug 21, 2017 8:46 pm

Thanks jonb, great to get this information!

SteveF
Posts: 429
Joined: Fri Aug 28, 2015 8:34 pm

Re: "Unfixable bug" in BBC B Elite

Postby SteveF » Mon Aug 21, 2017 10:27 pm

BigEd wrote:(great link to brainwagon. There's an online in-browser Minskytron here.)

That's quite addictive! :-) Thanks for the link!

User avatar
davidjefferies
Posts: 10
Joined: Thu Jul 14, 2016 2:40 pm

Re: "Unfixable bug" in BBC B Elite

Postby davidjefferies » Tue Aug 22, 2017 8:28 am

Rich Talbot-Watkins wrote:That code is actually making use of a peculiar thing called the Minsky Recurrence.

Interesting, I hadn't encountered that before. The example given in the article is using the Minsky Recurrence to draw a (near)circle without the use of trig or square roots. Strange then that Bell implemented an entirely separate routine using a sine table for drawing the planets. Perhaps it was too noticeable it wasn't a circle. I'm just setting off on holiday otherwise I'd knock up an example to verify this.

User avatar
Rich Talbot-Watkins
Posts: 1090
Joined: Thu Jan 13, 2005 5:20 pm
Location: Palma, Mallorca

Re: "Unfixable bug" in BBC B Elite

Postby Rich Talbot-Watkins » Tue Aug 22, 2017 9:26 am

I guess Elite doesn't use it for planet rendering because planets also have ellipse arcs on their longitude, which can't be calculated with the Minsky recurrence.

Here's a BBC BASIC program to draw a Minsky circle, using floating point.
Image

With integers, it looks decidedly worse, but still kind of circly!


Return to “software: classic games”

Who is online

Users browsing this forum: No registered users and 4 guests