Re:Fully documented source code for Elite on the BBC Micro
by NCG_Mike on Monday September 28, 2020 @04:55AM
(#24614515)
I assume they had a scaled up integer sin and tan tables and used matrices for scale, rotation and projection?
I do remember seeing this in 68K.
Re:Fully documented source code for Elite on the BBC Micro
by MarkMoxon on Monday September 28, 2020 @05:52AM
(#24614891)
There are tables for sin, cos and arctan, but these are only used for drawing the planet’s circles. All the ship-drawing and universe manipulation is done using the small angle approximation, so there’s no need for lookup tables.
Lots more info here:
https://www.bbcelite.com/explore/articles/deep_dive_pitching...
I recommend everyone should read some well optimised code occasionally, and figure out how it works, to see how it's done.
I didn't know much in the way of assembler techniques before reading the Elite code. For example I didn't even know how to do things like multiply or square root, or draw lines efficiently. That's where I learned those things.
It did take quite a lot of studying the printout to get it. So many "aha! that's how they do it" moments.